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:
parent
24e033ac79
commit
70e84021f2
@ -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) ->
|
||||
|
Loading…
Reference in New Issue
Block a user