diff options
author | Christophe Romain <christophe.romain@process-one.net> | 2015-10-07 01:06:58 +0300 |
---|---|---|
committer | Christophe Romain <christophe.romain@process-one.net> | 2015-10-07 15:18:38 +0300 |
commit | 6aeb9dcb38921249cdfe453baeadcd03298d5d6e (patch) | |
tree | df5559ad1f52ec9ed536c8399fd5bde714985059 /src/ejabberd_hooks.erl | |
parent | 83dd79a6a78c8ac5c5a73143caa1a23c3a0a7f6e (diff) |
cosmetic cleanup
Diffstat (limited to 'src/ejabberd_hooks.erl')
-rw-r--r-- | src/ejabberd_hooks.erl | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/ejabberd_hooks.erl b/src/ejabberd_hooks.erl index d136ba705..dd03e4ca4 100644 --- a/src/ejabberd_hooks.erl +++ b/src/ejabberd_hooks.erl @@ -58,9 +58,6 @@ -include("logger.hrl"). -%% Timeout of 5 seconds in calls to distributed hooks --define(TIMEOUT_DISTRIBUTED_HOOK, 5000). - -record(state, {}). -type local_hook() :: { Seq :: integer(), Module :: atom(), Function :: atom()}. -type distributed_hook() :: { Seq :: integer(), Node :: atom(), Module :: atom(), Function :: atom()}. @@ -310,7 +307,7 @@ run1([], _Hook, _Args) -> %% It is not attempted again in case of failure. Next hook will be executed run1([{_Seq, Node, Module, Function} | Ls], Hook, Args) -> %% MR: Should we have a safe rpc, like we have a safe apply or is bad_rpc enough ? - case rpc:call(Node, Module, Function, Args, ?TIMEOUT_DISTRIBUTED_HOOK) of + case ejabberd_cluster:call(Node, Module, Function, Args) of timeout -> ?ERROR_MSG("Timeout on RPC to ~p~nrunning hook: ~p", [Node, {Hook, Args}]), @@ -344,7 +341,7 @@ run1([{_Seq, Module, Function} | Ls], Hook, Args) -> run_fold1([], _Hook, Val, _Args) -> Val; run_fold1([{_Seq, Node, Module, Function} | Ls], Hook, Val, Args) -> - case rpc:call(Node, Module, Function, [Val | Args], ?TIMEOUT_DISTRIBUTED_HOOK) of + case ejabberd_cluster:call(Node, Module, Function, [Val | Args]) of {badrpc, Reason} -> ?ERROR_MSG("Bad RPC error to ~p: ~p~nrunning hook: ~p", [Node, Reason, {Hook, Args}]), |