diff options
author | Kim Alvefur <zash@zash.se> | 2018-07-10 00:51:55 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2018-07-10 00:51:55 +0200 |
commit | e5affafd0c1cef9d5ca8aefa49c8946300dc54cf (patch) | |
tree | 0c0ebf920e0099048797da53cd0d529dc3d1e796 /plugins/mod_pubsub | |
parent | 565fdda0fad30d02cbbcf7ea2889a1e67bfa1dad (diff) | |
download | prosody-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')
-rw-r--r-- | plugins/mod_pubsub/pubsub.lib.lua | 3 |
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 |