aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_pubsub/pubsub.lib.lua
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
commite5affafd0c1cef9d5ca8aefa49c8946300dc54cf (patch)
tree0c0ebf920e0099048797da53cd0d529dc3d1e796 /plugins/mod_pubsub/pubsub.lib.lua
parent565fdda0fad30d02cbbcf7ea2889a1e67bfa1dad (diff)
downloadprosody-e5affafd0c1cef9d5ca8aefa49c8946300dc54cf.tar.gz
prosody-e5affafd0c1cef9d5ca8aefa49c8946300dc54cf.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/pubsub.lib.lua')
-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