diff options
author | Simon MacMullen <simon@rabbitmq.com> | 2011-01-26 16:28:10 +0000 |
---|---|---|
committer | Simon MacMullen <simon@rabbitmq.com> | 2011-01-26 16:28:10 +0000 |
commit | 934688ae55c393bc2ddc693cd1e141e5cd761fa4 (patch) | |
tree | 407ad27043f2fd438ac9cff02a04e24459096be1 | |
parent | cfca23b81c44262977f879ec53e6bfac0792c8b8 (diff) | |
download | rabbitmq-server-934688ae55c393bc2ddc693cd1e141e5cd761fa4.tar.gz |
Treat all {badrpc, _}s the same. Use which_applications/1.
-rw-r--r-- | src/rabbit_control.erl | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/rabbit_control.erl b/src/rabbit_control.erl index a7d07b0f..8a19dcfb 100644 --- a/src/rabbit_control.erl +++ b/src/rabbit_control.erl @@ -304,19 +304,19 @@ action(wait, Node, [], _Opts, Inform) -> Inform("Waiting for ~p", [Node]), wait_for_application(Node, ?WAIT_FOR_VM_TIMEOUT). -wait_for_application(_Node, NodeTimeout) when NodeTimeout =< 0 -> - {badrpc, nodedown}; - wait_for_application(Node, NodeTimeout) -> - case call(Node, {application, which_applications, []}) of - {badrpc, nodedown} -> wait_for_application0(Node, NodeTimeout - 1000); - {badrpc, _} = E -> E; - Apps -> case proplists:is_defined(rabbit, Apps) of - %% We've seen the node up; if it goes down - %% die immediately. - false -> wait_for_application0(Node, 0); - true -> ok - end + case call(Node, {application, which_applications, [infinity]}) of + {badrpc, _} = E -> NewTimeout = NodeTimeout - 1000, + case NewTimeout =< 0 of + true -> E; + false -> wait_for_application0(Node, NewTimeout) + end; + Apps -> case proplists:is_defined(rabbit, Apps) of + %% We've seen the node up; if it goes down + %% die immediately. + true -> ok; + false -> wait_for_application0(Node, 0) + end end. wait_for_application0(Node, NodeTimeout) -> |