From 476c3d7bda428ec9cc8d96854ec33904df691404 Mon Sep 17 00:00:00 2001 From: Nelson Vides Date: Wed, 26 Jan 2022 16:01:09 +0100 Subject: [PATCH] Fix configuration key for cache name --- src/mongoose_user_cache.erl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/mongoose_user_cache.erl b/src/mongoose_user_cache.erl index 0cb4ab55e41..035b4850cd4 100644 --- a/src/mongoose_user_cache.erl +++ b/src/mongoose_user_cache.erl @@ -92,11 +92,14 @@ handle_telemetry_event([segmented_cache, request], #{hit := Hit, time := Latency -spec stop_cache(mongooseim:host_type(), module()) -> ok. stop_cache(HostType, Module) -> - ok = ejabberd_sup:stop_child(cache_name(HostType, Module)). + case gen_mod:get_module_opt(HostType, Module, module, internal) of + internal -> ok = ejabberd_sup:stop_child(cache_name(HostType, Module)); + _ConfiguredModule -> ok + end. -spec cache_name(mongooseim:host_type(), module()) -> atom(). cache_name(HostType, Module) -> - case gen_mod:get_module_opt(HostType, Module, cache_name, internal) of + case gen_mod:get_module_opt(HostType, Module, module, internal) of internal -> gen_mod:get_module_proc(HostType, Module); ConfiguredModule -> gen_mod:get_module_proc(HostType, ConfiguredModule) end.