aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_pubsub
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-07-10 00:51:55 +0200
committerKim Alvefur <zash@zash.se>2018-07-10 00:51:55 +0200
commit76ea0c210764f4c26c76735647b8b486816f4a03 (patch)
tree0c0ebf920e0099048797da53cd0d529dc3d1e796 /plugins/mod_pubsub
parent6eafee4a6e79acdcad36be2a10a196c87929dcce (diff)
downloadprosody-76ea0c210764f4c26c76735647b8b486816f4a03.tar.gz
prosody-76ea0c210764f4c26c76735647b8b486816f4a03.zip
mod_pubsub: Cache only max_items to avoid holding reference to possibly outdated config
Only max_items is used anyways
Diffstat (limited to 'plugins/mod_pubsub')
-rw-r--r--plugins/mod_pubsub/pubsub.lib.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/plugins/mod_pubsub/pubsub.lib.lua b/plugins/mod_pubsub/pubsub.lib.lua
index 82c44a16..ebeb6175 100644
--- a/plugins/mod_pubsub/pubsub.lib.lua
+++ b/plugins/mod_pubsub/pubsub.lib.lua
@@ -596,9 +596,10 @@ end
local function archive_itemstore(archive, config, user, node)
module:log("debug", "Creation of itemstore for node %s with config %s", node, config);
local get_set = {};
+ local max_items = config["max_items"];
function get_set:items() -- luacheck: ignore 212/self
local data, err = archive:find(user, {
- limit = tonumber(config["max_items"]);
+ limit = tonumber(max_items);
reverse = true;
});
if not data then