25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-10-31 15:21:38 +01:00

Check a node of a migrating process (EJABS-1908)

This commit is contained in:
Evgeniy Khramtsov 2012-09-27 12:34:26 +10:00
parent f0c745b916
commit 083dfe01ea
3 changed files with 12 additions and 6 deletions

View File

@ -221,8 +221,10 @@ stop_or_detach(FsmRef) ->
end. end.
migrate(FsmRef, Node, After) -> migrate(FsmRef, Node, After) when node(FsmRef) == node() ->
erlang:send_after(After, FsmRef, {migrate, Node}). erlang:send_after(After, FsmRef, {migrate, Node});
migrate(_FsmRef, _Node, _After) ->
ok.
migrate_shutdown(FsmRef, Node, After) -> migrate_shutdown(FsmRef, Node, After) ->
FsmRef ! {migrate_shutdown, Node, After}. FsmRef ! {migrate_shutdown, Node, After}.

View File

@ -117,8 +117,10 @@ start_link(StateName, StateData) ->
(?GEN_FSM):start_link(?MODULE, [StateName, StateData], (?GEN_FSM):start_link(?MODULE, [StateName, StateData],
?FSMOPTS). ?FSMOPTS).
migrate(FsmRef, Node, After) -> migrate(FsmRef, Node, After) when node(FsmRef) == node() ->
erlang:send_after(After, FsmRef, {migrate, Node}). erlang:send_after(After, FsmRef, {migrate, Node});
migrate(_FsmRef, _Node, _After) ->
ok.
moderate_room_history(FsmRef, Nick) -> moderate_room_history(FsmRef, Nick) ->
(?GEN_FSM):sync_send_all_state_event(FsmRef, (?GEN_FSM):sync_send_all_state_event(FsmRef,

View File

@ -206,8 +206,10 @@ sockname(_Socket) -> {ok, {{0, 0, 0, 0}, 0}}.
peername({http_bind, _FsmRef, IP}) -> {ok, IP}. peername({http_bind, _FsmRef, IP}) -> {ok, IP}.
migrate(FsmRef, Node, After) -> migrate(FsmRef, Node, After) when node(FsmRef) == node() ->
erlang:send_after(After, FsmRef, {migrate, Node}). erlang:send_after(After, FsmRef, {migrate, Node});
migrate(_FsmRef, _Node, _After) ->
ok.
process_request(Data, IP, Type) -> process_request(Data, IP, Type) ->
Opts1 = ejabberd_c2s_config:get_c2s_limits(), Opts1 = ejabberd_c2s_config:get_c2s_limits(),