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 | 76ea0c210764f4c26c76735647b8b486816f4a03 (patch) | |
tree | 0c0ebf920e0099048797da53cd0d529dc3d1e796 /plugins/mod_pubsub/pubsub.lib.lua | |
parent | 6eafee4a6e79acdcad36be2a10a196c87929dcce (diff) | |
download | prosody-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/pubsub.lib.lua')
-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 |