]> granicus.if.org Git - ejabberd/commitdiff
Describe option type of 'domain_balancing'
authorEvgeniy Khramtsov <ekhramtsov@process-one.net>
Fri, 15 Jan 2016 11:32:10 +0000 (14:32 +0300)
committerEvgeniy Khramtsov <ekhramtsov@process-one.net>
Fri, 15 Jan 2016 11:32:10 +0000 (14:32 +0300)
src/ejabberd_router.erl

index 8a579814c5fb0ec4e202df213756c151d9a5c054..5ca1262e675573e2d3ebea75bfb51c1afb50e258 100644 (file)
@@ -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].