Skip to content

Commit

Permalink
minor changes according to the code review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
DenysGonchar committed May 5, 2021
1 parent 88c1b5a commit 928be17
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion big_tests/tests/push_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
-define(RPC_SPEC, distributed_helper:mim()).
-define(SESSION_KEY, publish_service).

-define(VIRTUAL_PUBSUB_DOMAIN,<<"virtual.domain">>).
-define(VIRTUAL_PUBSUB_DOMAIN, <<"virtual.domain">>).

%%--------------------------------------------------------------------
%% Suite configuration
Expand Down
5 changes: 5 additions & 0 deletions src/domain/mongoose_subdomain_utils.erl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
-type subdomain_pattern() :: {fqdn | prefix, binary()}.
-export_type([subdomain_pattern/0]).

%% this function preprocesses configuration subdomain templates like:
%% "subdomain.@HOST@"
%% it is compatible with mongoose_config_parser_toml:processor() type,
%% so it can be used as #option.process value (for more information see
%% mongoose_config_spec.hrl)
-spec make_subdomain_pattern(SubdomainPatternConfigOpt :: binary() | string()) ->
subdomain_pattern().
make_subdomain_pattern(ConfigOpt) when is_list(ConfigOpt) ->
Expand Down
6 changes: 3 additions & 3 deletions src/gen_mod.erl
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@
}).

-type module_feature() :: atom().
-type domain_name() :: jid:server().
-type host_type() :: binary().
-type domain_name() :: mongooseim:domain_name().
-type host_type() :: mongooseim:host_type().

%% -export([behaviour_info/1]).
%% behaviour_info(callbacks) ->
Expand All @@ -109,7 +109,7 @@
%% TODO: think about getting rid of HostType param for deps/2 interface, currently
%% it's used only by global_distrib modules (see mod_global_distrib_utils:deps/4
%% function).
-callback deps(HostType :: binary(), Opts :: proplists:list()) -> deps_list().
-callback deps(HostType :: host_type(), Opts :: proplists:list()) -> deps_list().

-optional_callbacks([config_spec/0, supported_features/0, deps/2]).

Expand Down
7 changes: 5 additions & 2 deletions test/mongoose_domain_core_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ all() ->
get_domains_by_host_type,
host_type_check,
can_get_outdated_domains,
run_for_each_domains].
run_for_each_domain].

init_per_suite(Config) ->
meck:new(mongoose_hooks, [no_link]),
Expand Down Expand Up @@ -137,7 +137,10 @@ can_get_outdated_domains(_) ->
[] = mongoose_domain_core:get_all_outdated(dummy_src),
[] = mongoose_domain_core:get_all_outdated(another_dummy_src).

run_for_each_domains(_) ->
run_for_each_domain(_) ->
%% NumOfDomains is just some big non-round number to ensure that more than 2 ets
%% selections are done during the call to mongoose_domain_core:for_each_domain/2.
%% currently max selection size is 100 domains.
NumOfDomains = 1234,
NewDomains = [<<"dummy_domain_", (integer_to_binary(N))/binary, ".localhost">>
|| N <- lists:seq(1, NumOfDomains)],
Expand Down

0 comments on commit 928be17

Please sign in to comment.