# HG changeset patch # User Kim Alvefur # Date 1531176715 -7200 # Node ID 7203a1b65d1b95cd8f8ee0bc7f38934d1a7dcafb # Parent 50a0f405e6c9a4906b0cc3d3adb9c5ca65c01bba mod_pubsub: Cache only max_items to avoid holding reference to possibly outdated config Only max_items is used anyways diff -r 50a0f405e6c9 -r 7203a1b65d1b plugins/mod_pubsub/pubsub.lib.lua --- a/plugins/mod_pubsub/pubsub.lib.lua Tue Jul 10 00:22:05 2018 +0200 +++ b/plugins/mod_pubsub/pubsub.lib.lua Tue Jul 10 00:51:55 2018 +0200 @@ -596,9 +596,10 @@ 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