25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-24 17:29:28 +01:00

Remove global lock if there are no nodes available

This commit is contained in:
jabber 2011-04-17 06:05:48 +04:00 committed by Evgeniy Khramtsov
parent 24e033ac79
commit 70e84021f2

View File

@ -136,9 +136,13 @@ handle_call(announce, _From, State) ->
{node_ready, node()}, ?REHASH_TIMEOUT),
append_node(?HASHTBL, node()),
register(?MODULE, self()),
gen_server:abcast(OtherNodes -- BadNodes,
?MODULE, {node_ready, node()}),
erlang:send_after(?MIGRATE_TIMEOUT, self(), del_lock)
case OtherNodes -- BadNodes of
[] ->
global:del_lock(?LOCK);
WorkingNodes ->
gen_server:abcast(WorkingNodes, ?MODULE, {node_ready, node()}),
erlang:send_after(?MIGRATE_TIMEOUT, self(), del_lock)
end
end,
{reply, ok, State};
handle_call({node_ready, Node}, _From, State) ->