Skip to content

Commit

Permalink
Minor fixes after code review
Browse files Browse the repository at this point in the history
  • Loading branch information
chrzaszcz committed Mar 17, 2022
1 parent 7286e37 commit 1b29057
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 2 additions & 6 deletions big_tests/tests/mod_global_distrib_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,7 @@ init_per_suite(Config) ->
ok = rpc(europe_node2, mongoose_cluster, join, [ct:get_config(europe_node1)]),

enable_logging(),
% We have to pass [no_opts] because [] is treated as string and converted
% automatically to <<>>
escalus:init_per_suite([{add_advertised_endpoints, []},
{extra_config, #{}} | Config]);
escalus:init_per_suite([{add_advertised_endpoints, []}, {extra_config, #{}} | Config]);
Result ->
ct:pal("Redis check result: ~p", [Result]),
{skip, "GD Redis default pool not available"}
Expand Down Expand Up @@ -207,8 +204,7 @@ init_modules_per_node({NodeName, LocalHost, ReceiverPort}, Config0) ->
Config1.

module_opts(ExtraOpts) ->
lists:foldl(fun(Step, OptsIn) -> set_opts(Step, OptsIn) end,
ExtraOpts, [common, defaults, connections, redis, bounce]).
lists:foldl(fun set_opts/2, ExtraOpts, [common, defaults, connections, redis, bounce]).

set_opts(common, Opts) ->
maps:merge(#{global_host => <<"localhost">>,
Expand Down
4 changes: 4 additions & 0 deletions src/global_distrib/mod_global_distrib.erl
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
%% gen_mod API
%%--------------------------------------------------------------------

%% Note: while this module should be enabled for all hosts,
%% it needs to be started only once - this is why deps/2 and start/2
%% do nothing for hosts other than global_host

-spec deps(mongooseim:host_type(), gen_mod:module_opts()) -> gen_mod_deps:deps().
deps(HostType, Opts = #{global_host := HostType, bounce := BounceOpts}) ->
%% Start each required module with the same opts for simplicity
Expand Down

0 comments on commit 1b29057

Please sign in to comment.