Skip to content

Commit

Permalink
Fix configuration key for cache name
Browse files Browse the repository at this point in the history
  • Loading branch information
NelsonVides committed Jan 26, 2022
1 parent c9b7d21 commit 476c3d7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/mongoose_user_cache.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 476c3d7

Please sign in to comment.