mod_storage_sql: Fix traceback on multi-user deletion

jid.join(true, ...) fails.

Since we don't know which users this affects, best to clear the whole
cache.
0.12
Kim Alvefur 4 years ago
parent 59258d47bd
commit 0d9065ae80
  1. 8
      plugins/mod_storage_sql.lua

@ -624,8 +624,12 @@ function archive_store:delete(username, query)
end
return engine:delete(sql_query, unpack(args));
end);
local cache_key = jid_join(username, host, self.store);
archive_item_count_cache:set(cache_key, nil);
if username == true then
archive_item_count_cache:clear();
else
local cache_key = jid_join(username, host, self.store);
archive_item_count_cache:set(cache_key, nil);
end
return ok and stmt:affected(), stmt;
end

Loading…
Cancel
Save