Skip to content

Commit

Permalink
Merge pull request #3518 from esl/cache_name
Browse files Browse the repository at this point in the history
Fix configuration key for cache name
  • Loading branch information
chrzaszcz authored Jan 27, 2022
2 parents 6f72056 + 476c3d7 commit 18eebd6
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 18eebd6

Please sign in to comment.