Skip to content

Commit

Permalink
Merge pull request #3508 from esl/config/enable_caches
Browse files Browse the repository at this point in the history
Fix starting new caches
  • Loading branch information
arcusfelis committed Jan 19, 2022
2 parents 8ef7d9a + 3ac2593 commit 1bf42b9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/mongoose_user_cache.erl
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ process_cache_config(KVs) ->

-spec start_new_cache(mongooseim:host_type(), module(), gen_mod:module_opts()) -> any().
start_new_cache(HostType, Module, Opts) ->
case gen_mod:get_opt(module, Opts, internal) of
internal -> do_start_new_cache(HostType, Module, Opts);
_ -> ok
end.

do_start_new_cache(HostType, Module, Opts) ->
CacheName = gen_mod:get_module_proc(HostType, Module),
CacheOpts = #{merger_fun => gen_mod:get_opt(merger_fun, Opts, fun maps:merge/2),
segment_num => gen_mod:get_opt(number_of_segments, Opts, 3),
Expand Down

0 comments on commit 1bf42b9

Please sign in to comment.