aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_storage_sql.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2019-03-22 02:10:46 +0100
committerKim Alvefur <zash@zash.se>2019-03-22 02:10:46 +0100
commit61edbdb90f50b71c6a13f24e7621b561fef9b3ac (patch)
tree48a4d684b0c81929fe516c929b2ecc2f78017d07 /plugins/mod_storage_sql.lua
parent3e5243f2d2df3e4933a9bd7fdaf13c848265178e (diff)
downloadprosody-61edbdb90f50b71c6a13f24e7621b561fef9b3ac.tar.gz
prosody-61edbdb90f50b71c6a13f24e7621b561fef9b3ac.zip
mod_storage_sql: Fix to use currently queried store
Was using the previously queried store due to this being cached in an upvalue.
Diffstat (limited to 'plugins/mod_storage_sql.lua')
-rw-r--r--plugins/mod_storage_sql.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/mod_storage_sql.lua b/plugins/mod_storage_sql.lua
index 154daf06..325fab94 100644
--- a/plugins/mod_storage_sql.lua
+++ b/plugins/mod_storage_sql.lua
@@ -238,7 +238,8 @@ archive_store.caps = {
};
archive_store.__index = archive_store
function archive_store:append(username, key, value, when, with)
- local cache_key = jid_join(username, host, self.store);
+ local user,store = username,self.store;
+ local cache_key = jid_join(username, host, store);
local item_count = archive_item_count_cache:get(cache_key);
if not item_count then
local ok, ret = engine:transaction(function()
@@ -265,7 +266,6 @@ function archive_store:append(username, key, value, when, with)
return nil, "quota-limit";
end
- local user,store = username,self.store;
when = when or os.time();
with = with or "";
local ok, ret = engine:transaction(function()