diff options
author | Kim Alvefur <zash@zash.se> | 2019-03-22 02:13:27 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2019-03-22 02:13:27 +0100 |
commit | e21f31c7c282aa5fba3c37e6d1e829edb3b78a6b (patch) | |
tree | 6f3b9a2a462020d4010e94f90dfc65618f91d091 | |
parent | 79bebb21f83365e33208644f1c0060752f4fc532 (diff) | |
download | prosody-e21f31c7c282aa5fba3c37e6d1e829edb3b78a6b.tar.gz prosody-e21f31c7c282aa5fba3c37e6d1e829edb3b78a6b.zip |
mod_storage_sql: Cache total count if it's calculated as part of the current query
-rw-r--r-- | plugins/mod_storage_sql.lua | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/plugins/mod_storage_sql.lua b/plugins/mod_storage_sql.lua index 35a16870..b3bd5171 100644 --- a/plugins/mod_storage_sql.lua +++ b/plugins/mod_storage_sql.lua @@ -384,6 +384,9 @@ function archive_store:find(username, query) total = row[1]; end end + if query.start == nil and query.with == nil and query["end"] == nil and query.key == nil then + archive_item_count_cache:set(cache_key, total); + end if query.limit == 0 then -- Skip the real query return noop, total; end |