Skip to content

Commit 9bc3d5e

Browse files
Merge pull request #13210 from frederikbosch/disable_health_check
Peer discovery: disable consul health check helper when registration is disabled
2 parents ee78e27 + b821e52 commit 9bc3d5e

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

deps/rabbit/src/rabbit_peer_discovery.erl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
maybe_unregister/0,
2323
discover_cluster_nodes/0]).
2424
-export([backend/0,
25+
should_perform_registration/0,
2526
node_type/0,
2627
normalize/1,
2728
append_node_prefix/1,

deps/rabbitmq_peer_discovery_consul/src/rabbitmq_peer_discovery_consul_health_check_helper.erl

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,17 @@ start_link() ->
3333
gen_server:start_link({local, ?MODULE}, ?MODULE, [], []).
3434

3535
init([]) ->
36-
case rabbit_peer_discovery:backend() of
37-
rabbit_peer_discovery_consul ->
38-
set_up_periodic_health_check();
39-
rabbitmq_peer_discovery_consul ->
40-
set_up_periodic_health_check();
41-
_ ->
36+
case rabbit_peer_discovery:should_perform_registration() of
37+
true ->
38+
case rabbit_peer_discovery:backend() of
39+
rabbit_peer_discovery_consul ->
40+
set_up_periodic_health_check();
41+
rabbitmq_peer_discovery_consul ->
42+
set_up_periodic_health_check();
43+
_ ->
44+
{ok, #state{}}
45+
end;
46+
false ->
4247
{ok, #state{}}
4348
end.
4449

0 commit comments

Comments
 (0)