25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-24 16:23:40 +01:00

Describe option type of 'domain_balancing'

This commit is contained in:
Evgeniy Khramtsov 2016-01-15 14:32:10 +03:00
parent 09ab01084d
commit 1d452c98c1

View File

@ -344,8 +344,8 @@ do_route(OrigFrom, OrigTo, OrigPacket) ->
end; end;
Rs -> Rs ->
Value = case Value = case
ejabberd_config:get_local_option({domain_balancing, ejabberd_config:get_option({domain_balancing,
LDstDomain}, fun(D) when is_atom(D) -> D end) LDstDomain}, fun(D) when is_atom(D) -> D end)
of of
undefined -> p1_time_compat:monotonic_time(); undefined -> p1_time_compat:monotonic_time();
random -> p1_time_compat:monotonic_time(); random -> p1_time_compat:monotonic_time();
@ -408,7 +408,13 @@ update_tables() ->
false -> ok false -> ok
end. end.
opt_type(domain_balancing) ->
fun (random) -> random;
(source) -> source;
(destination) -> destination;
(bare_source) -> bare_source;
(bare_destination) -> bare_destination
end;
opt_type(domain_balancing_component_number) -> opt_type(domain_balancing_component_number) ->
fun (N) when is_integer(N), N > 1 -> N end; fun (N) when is_integer(N), N > 1 -> N end;
opt_type(_) -> [domain_balancing_component_number]. opt_type(_) -> [domain_balancing, domain_balancing_component_number].