# HG changeset patch # User Kim Alvefur # Date 1635982601 -3600 # Node ID 19f67d44ec37fc572e55f7629287d121981dad4c # Parent 1dc00ca6ee9d8ff38176f62fbe283eedba4143e3 mod_pep: Limit possible growth of node subscription info diff -r 1dc00ca6ee9d -r 19f67d44ec37 plugins/mod_pep.lua --- a/plugins/mod_pep.lua Thu Nov 04 00:35:44 2021 +0100 +++ b/plugins/mod_pep.lua Thu Nov 04 00:36:41 2021 +0100 @@ -33,11 +33,14 @@ 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;