diff options
author | Holger Weiss <holger@zedat.fu-berlin.de> | 2022-01-25 16:57:27 +0100 |
---|---|---|
committer | Holger Weiss <holger@zedat.fu-berlin.de> | 2022-01-25 16:57:27 +0100 |
commit | 52ac9410346b833262b876e8a120c7532955ab47 (patch) | |
tree | 16c8dc0e45c7baf368428ce9bdd020d535b28c43 /src | |
parent | Remove reference to the obsolete Vagrant environment (diff) |
mod_shared_roster: Adjust special group cache size
Let the size of the cache used for 'special' groups (such as @all@ or
@online@) depend on the number of virtual hosts, as the cache will
contain seperate entries per domain.
Thanks to Ingo Jürgensmann for reporting the issue.
Diffstat (limited to 'src')
-rw-r--r-- | src/mod_shared_roster.erl | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mod_shared_roster.erl b/src/mod_shared_roster.erl index 358a8df3..f92e1649 100644 --- a/src/mod_shared_roster.erl +++ b/src/mod_shared_roster.erl @@ -150,7 +150,8 @@ depends(_Host, _Opts) -> -spec init_cache(module(), binary(), gen_mod:opts()) -> ok. init_cache(Mod, Host, Opts) -> - ets_cache:new(?SPECIAL_GROUPS_CACHE, [{max_size, 4}]), + NumHosts = length(ejabberd_option:hosts()), + ets_cache:new(?SPECIAL_GROUPS_CACHE, [{max_size, NumHosts * 4}]), case use_cache(Mod, Host) of true -> CacheOpts = cache_opts(Opts), |