From 4a89e829d4f0eadf57b3bf21c41f1198171936cc Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Thu, 4 Nov 2021 00:36:41 +0100 Subject: mod_pep: Limit possible growth of node subscription info --- plugins/mod_pep.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'plugins') 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; -- cgit v1.2.3