aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_pep.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-11-04 00:36:41 +0100
committerKim Alvefur <zash@zash.se>2021-11-04 00:36:41 +0100
commit4a89e829d4f0eadf57b3bf21c41f1198171936cc (patch)
treeca545b1a10264ebe980e54fc9e04135273dc9b56 /plugins/mod_pep.lua
parentcc03265206ff7c693d8139bf3babfc9ace9b3928 (diff)
downloadprosody-4a89e829d4f0eadf57b3bf21c41f1198171936cc.tar.gz
prosody-4a89e829d4f0eadf57b3bf21c41f1198171936cc.zip
mod_pep: Limit possible growth of node subscription info
Diffstat (limited to 'plugins/mod_pep.lua')
-rw-r--r--plugins/mod_pep.lua7
1 files changed, 5 insertions, 2 deletions
diff --git a/plugins/mod_pep.lua b/plugins/mod_pep.lua
index afa3a38b..df29afdc 100644
--- a/plugins/mod_pep.lua
+++ b/plugins/mod_pep.lua
@@ -33,11 +33,14 @@ local services = cache.new(service_cache_size, function (username, _)
end
end):table();
+-- size of caches with smaller objects
+local info_cache_size = module:get_option_number("pep_info_cache_size", 10000);
+
-- username -> recipient -> set of nodes
-local recipients = {};
+local recipients = cache.new(info_cache_size):table();
-- caps hash -> set of nodes
-local hash_map = {};
+local hash_map = cache.new(info_cache_size):table();
local host = module.host;