From 1d452c98c136105a09173273fd55fbe9a1e513ec Mon Sep 17 00:00:00 2001 From: Evgeniy Khramtsov Date: Fri, 15 Jan 2016 14:32:10 +0300 Subject: [PATCH] Describe option type of 'domain_balancing' --- src/ejabberd_router.erl | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/ejabberd_router.erl b/src/ejabberd_router.erl index 8a579814c..5ca1262e6 100644 --- a/src/ejabberd_router.erl +++ b/src/ejabberd_router.erl @@ -344,8 +344,8 @@ do_route(OrigFrom, OrigTo, OrigPacket) -> end; Rs -> Value = case - ejabberd_config:get_local_option({domain_balancing, - LDstDomain}, fun(D) when is_atom(D) -> D end) + ejabberd_config:get_option({domain_balancing, + LDstDomain}, fun(D) when is_atom(D) -> D end) of undefined -> p1_time_compat:monotonic_time(); random -> p1_time_compat:monotonic_time(); @@ -408,7 +408,13 @@ update_tables() -> false -> ok 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) -> fun (N) when is_integer(N), N > 1 -> N end; -opt_type(_) -> [domain_balancing_component_number]. +opt_type(_) -> [domain_balancing, domain_balancing_component_number].