diff --git a/plugins/mod_storage_sql.lua b/plugins/mod_storage_sql.lua index f034a0ebd..deafb0050 100644 --- a/plugins/mod_storage_sql.lua +++ b/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