diff options
| author | Francesco Mazzoli <francesco@rabbitmq.com> | 2012-07-09 19:59:36 +0100 |
|---|---|---|
| committer | Francesco Mazzoli <francesco@rabbitmq.com> | 2012-07-09 19:59:36 +0100 |
| commit | 4a6c12e9e9edef71f6fd330fc8e8412818978433 (patch) | |
| tree | 4082e52b424020123cb2a565954fbb074ebfeb10 /src | |
| parent | d5d5d6231ce2497195a9374ee09aa044acf650f7 (diff) | |
| download | rabbitmq-server-git-4a6c12e9e9edef71f6fd330fc8e8412818978433.tar.gz | |
cosmetic
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_mnesia.erl | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/src/rabbit_mnesia.erl b/src/rabbit_mnesia.erl index 3d5af04844..b1a4759a18 100644 --- a/src/rabbit_mnesia.erl +++ b/src/rabbit_mnesia.erl @@ -461,22 +461,23 @@ mnesia_nodes() -> cluster_status(WhichNodes, ForceMnesia) -> %% I don't want to call `running_nodes/1' unless if necessary, since it can %% deadlock when stopping applications. - case case mnesia_nodes() of - {ok, {AllNodes, DiscNodes}} -> - {ok, {AllNodes, DiscNodes, - fun() -> running_nodes(AllNodes) end}}; - {error, _Reason} when not ForceMnesia -> - {AllNodes, DiscNodes, RunningNodes} = - rabbit_node_monitor:read_cluster_status_file(), - %% The cluster status file records the status when the node is - %% online, but we know for sure that the node is offline now, so - %% we can remove it from the list of running nodes. - {ok, {AllNodes, DiscNodes, - fun() -> ordsets:del_element(node(), RunningNodes) end}}; - Err = {error, _} -> - Err - end - of + Nodes = case mnesia_nodes() of + {ok, {AllNodes, DiscNodes}} -> + {ok, {AllNodes, DiscNodes, + fun() -> running_nodes(AllNodes) end}}; + {error, _Reason} when not ForceMnesia -> + {AllNodes, DiscNodes, RunningNodes} = + rabbit_node_monitor:read_cluster_status_file(), + %% The cluster status file records the status when the node + %% is online, but we know for sure that the node is offline + %% now, so we can remove it from the list of running nodes. + {ok, + {AllNodes, DiscNodes, + fun() -> ordsets:del_element(node(), RunningNodes) end}}; + Err = {error, _} -> + Err + end, + case Nodes of {ok, {AllNodes1, DiscNodes1, RunningNodesThunk}} -> {ok, case WhichNodes of status -> {AllNodes1, DiscNodes1, RunningNodesThunk()}; |
