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 | fc7dcd5b3f190cfb60463f6b9f298c27f1f7fe35 (patch) | |
| tree | 407ad27043f2fd438ac9cff02a04e24459096be1 | |
| parent | 306afd02529066aeb470a118f106d14dce441742 (diff) | |
| download | rabbitmq-server-git-fc7dcd5b3f190cfb60463f6b9f298c27f1f7fe35.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 a7d07b0f38..8a19dcfb79 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) -> |
