Software /
code /
prosody
Changeset
12087:19f67d44ec37 0.11
mod_pep: Limit possible growth of node subscription info
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 04 Nov 2021 00:36:41 +0100 |
parents | 12086:1dc00ca6ee9d |
children | 12088:e5028f6eb599 |
files | plugins/mod_pep.lua |
diffstat | 1 files changed, 5 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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;