Skip to content

Commit cd2b4c7

Browse files
committed
Use rabbit_nodes to list nodes in two plugins
... instead of using an internal implementation. The plugins are `rabbitmq_peer_discovery_common` and `rabbitmq_sharding`. References #7058.
1 parent 42bcd94 commit cd2b4c7

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

deps/rabbitmq_peer_discovery_common/src/rabbit_peer_discovery_cleanup.erl

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -288,13 +288,7 @@ maybe_remove_nodes([Node | Nodes], false) ->
288288
%%--------------------------------------------------------------------
289289
-spec unreachable_nodes() -> [node()].
290290
unreachable_nodes() ->
291-
Status = rabbit_mnesia:status(),
292-
Nodes = proplists:get_value(nodes, Status, []),
293-
Running = proplists:get_value(running_nodes, Status, []),
294-
All = lists:merge(proplists:get_value(disc, Nodes, []),
295-
proplists:get_value(ram, Nodes, [])),
296-
lists:subtract(All, Running).
297-
291+
rabbit_nodes:list_unreachable().
298292

299293
%%--------------------------------------------------------------------
300294
%% @private

deps/rabbitmq_sharding/src/rabbit_sharding_shard.erl

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,4 @@ v(#resource{virtual_host = VHost}) ->
127127
VHost.
128128

129129
foreach_node(F) ->
130-
[F(Node) || Node <- running_nodes()].
131-
132-
running_nodes() ->
133-
proplists:get_value(running_nodes, rabbit_mnesia:status(), []).
130+
[F(Node) || Node <- rabbit_nodes:list_running()].

0 commit comments

Comments
 (0)