Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix MAM cache name #3594

Merged
merged 1 commit into from
Mar 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/mam/mod_mam_cache_user.erl
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
%%====================================================================

-spec start(mongooseim:host_type(), gen_mod:module_opts()) -> ok.
start(HostType, Opts = #{cache := CacheOpts}) ->
start_cache(HostType, CacheOpts),
start(HostType, Opts) ->
start_cache(HostType, Opts),
ejabberd_hooks:add(hooks(HostType, Opts)),
ok.

Expand Down
2 changes: 1 addition & 1 deletion src/mam/mod_mam_meta.erl
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ add_rdbms_deps(user_cache, Type, #{cache_users := true, cache := CacheOpts}, Dep
internal -> Deps;
mod_cache_users -> add_dep(mod_cache_users, Deps)
end,
add_dep(mod_mam_cache_user, #{Type => true, cache => CacheOpts}, Deps1);
add_dep(mod_mam_cache_user, CacheOpts#{Type => true}, Deps1);
add_rdbms_deps(async_writer, Type, #{async_writer := AsyncOpts = #{enabled := true}}, Deps) ->
Deps1 = add_dep(rdbms_arch_module(Type), #{no_writer => true}, Deps),
add_dep(rdbms_async_arch_module(Type), AsyncOpts, Deps1);
Expand Down
2 changes: 1 addition & 1 deletion test/common/config_parser_helper.erl
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ all_modules() ->
host => {fqdn, <<"muc.example.com">>},
no_stanzaid_element => true}),
mod_caps => [{cache_life_time, 86}, {cache_size, 1000}],
mod_mam_cache_user => #{cache => default_config([modules, mod_mam_meta, cache]), muc => true, pm => true},
mod_mam_cache_user => (default_config([modules, mod_mam_meta, cache]))#{muc => true, pm => true},
mod_offline =>
[{access_max_user_messages, max_user_offline_messages},
{backend, riak},
Expand Down
6 changes: 3 additions & 3 deletions test/mod_mam_meta_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ produces_valid_configurations(_Config) ->
check_equal_opts(mod_mam_muc_rdbms_arch, mod_config(mod_mam_muc_rdbms_arch,
MUCArchOpts#{no_writer => true}), Deps),
check_equal_opts(mod_mam_rdbms_user, #{pm => true, muc => true}, Deps),
check_equal_opts(mod_mam_cache_user, #{pm => true, muc => true, cache => Cache}, Deps),
check_equal_opts(mod_mam_cache_user, Cache#{pm => true, muc => true}, Deps),
check_equal_opts(mod_mam_mnesia_prefs, #{muc => true}, Deps),
check_equal_opts(mod_mam_rdbms_prefs, #{pm => true}, Deps),
check_equal_opts(mod_mam_muc_rdbms_arch_async, AsyncOpts, Deps).
Expand Down Expand Up @@ -116,7 +116,7 @@ example_muc_only_no_pref_good_performance(_Config) ->

check_equal_deps(
[{mod_mam_rdbms_user, #{muc => true, pm => true}},
{mod_mam_cache_user, #{muc => true, cache => Cache}},
{mod_mam_cache_user, Cache#{muc => true}},
{mod_mam_muc_rdbms_arch, mod_config(mod_mam_muc_rdbms_arch, #{no_writer => true})},
{mod_mam_muc_rdbms_arch_async, AsyncOpts},
{mod_mam_muc, mod_config(mod_mam_muc, mod_config(mod_mam_muc, MUCOpts))}
Expand All @@ -130,7 +130,7 @@ example_pm_only_good_performance(_Config) ->

check_equal_deps(
[{mod_mam_rdbms_user, #{pm => true}},
{mod_mam_cache_user, #{pm => true, cache => Cache}},
{mod_mam_cache_user, Cache#{pm => true}},
{mod_mam_mnesia_prefs, #{pm => true}},
{mod_mam_rdbms_arch, mod_config(mod_mam_rdbms_arch, #{no_writer => true})},
{mod_mam_rdbms_arch_async, AsyncOpts},
Expand Down