Skip to content

Commit 66a46b9

Browse files
MarcialRosalesmergify[bot]
authored andcommitted
Clean up
(cherry picked from commit ae17c6c)
1 parent bcdfa27 commit 66a46b9

8 files changed

+10
-23
lines changed

deps/rabbitmq_shovel/src/rabbit_amqp091_shovel.erl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -630,10 +630,8 @@ decl_fun(Decl, _Conn, Ch) ->
630630
end || M <- lists:reverse(Decl)].
631631

632632
check_fun(Queue, _Conn, Ch) ->
633-
rabbit_log:debug("Checking if queue ~p exits", [Queue]),
634633
amqp_channel:call(Ch, #'queue.declare'{queue = Queue,
635-
passive = true}),
636-
rabbit_log:debug("Queue ~p exits", [Queue]).
634+
passive = true}).
637635

638636
parse_parameter(Param, Fun, Value) ->
639637
try

deps/rabbitmq_shovel/src/rabbit_shovel_config.erl

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,11 @@ convert_from_legacy(Config) ->
6666
{reconnect_delay, RD}].
6767

6868
parse(ShovelName, Config0) ->
69-
rabbit_log:debug("rabbit_shovel_config:parse ~p ~p", [ShovelName, Config0]),
7069
try
7170
validate(Config0),
7271
case is_legacy(Config0) of
7372
true ->
7473
Config = convert_from_legacy(Config0),
75-
rabbit_log:debug("rabbit_shovel_config:parse is_legacy -> ~p", [Config]),
7674
parse_current(ShovelName, Config);
7775
false ->
7876
parse_current(ShovelName, Config0)
@@ -126,7 +124,6 @@ validate_uris0([Uri | Uris]) ->
126124
validate_uris0([]) -> ok.
127125

128126
parse_current(ShovelName, Config) ->
129-
rabbit_log:debug("rabbit_shovel_config:parse_current ~p", [ShovelName]),
130127
{source, Source} = proplists:lookup(source, Config),
131128
validate(Source),
132129
SrcMod = resolve_module(proplists:get_value(protocol, Source, amqp091)),

deps/rabbitmq_shovel/src/rabbit_shovel_dyn_worker_sup.erl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ init([Name, Config0]) ->
5252
%% reconnect-delay = 0 means "do not reconnect"
5353
_ -> temporary
5454
end,
55-
rabbit_log:debug("rabbit_shovel_dyn_worker_sup Delay:~p Restart:~p", [Delay, Restart]),
5655
{ok, {{one_for_one, 1, ?MAX_WAIT},
5756
[{Name,
5857
{rabbit_shovel_worker, start_link, [dynamic, Name, Config]},

deps/rabbitmq_shovel/src/rabbit_shovel_parameters.erl

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
%% from and can break with the next upgrade. It should not be used by
2323
%% another one that the one who created it or survive a node restart.
2424
%% Thus, function references have been replace by the following MFA.
25-
-export([dest_decl/4, dest_check/4, src_decl_exchange/4, src_decl_queue/4,src_check_queue/4,
25+
-export([dest_decl/4, dest_check/4,
26+
src_decl_exchange/4, src_decl_queue/4, src_check_queue/4,
2627
fields_fun/5, props_fun/9]).
2728

2829
-import(rabbit_misc, [pget/2, pget/3, pset/3]).
@@ -360,7 +361,6 @@ parse_amqp091_dest({VHost, Name}, ClusterName, Def, SourceHeaders) ->
360361
AddTimestampHeaderLegacy = pget(<<"add-timestamp-header">>, Def, false),
361362
AddTimestampHeader = pget(<<"dest-add-timestamp-header">>, Def,
362363
AddTimestampHeaderLegacy),
363-
364364
%% Details are only used for status report in rabbitmqctl, as vhost is not
365365
%% available to query the runtime parameters.
366366
Details = maps:from_list([{K, V} || {K, V} <- [{dest_exchange, DestX},
@@ -373,7 +373,7 @@ parse_amqp091_dest({VHost, Name}, ClusterName, Def, SourceHeaders) ->
373373
fields_fun => {?MODULE, fields_fun, [X, Key]},
374374
props_fun => {?MODULE, props_fun, [Table0, Table2, SetProps,
375375
AddHeaders, SourceHeaders,
376-
AddTimestampHeader]}
376+
AddTimestampHeader]}
377377
}, Details).
378378

379379
fields_fun(X, Key, _SrcURI, _DestURI, P0) ->
@@ -455,15 +455,14 @@ parse_amqp091_source(Def) ->
455455
%% available to query the runtime parameters.
456456
Details = maps:from_list([{K, V} || {K, V} <- [{source_exchange, SrcX},
457457
{source_exchange_key, SrcXKey}],
458-
V =/= none]),
459-
458+
V =/= none]),
460459
{maps:merge(#{module => rabbit_amqp091_shovel,
461460
uris => SrcURIs,
462461
resource_decl => SrcDeclFun,
463462
queue => Queue,
464463
delete_after => opt_b2a(DeleteAfter),
465464
prefetch_count => PrefetchCount,
466-
consumer_args => SrcCArgs
465+
consumer_args => SrcCArgs
467466
}, Details), DestHeaders}.
468467

469468
src_decl_exchange(SrcX, SrcXKey, _Conn, Ch) ->

deps/rabbitmq_shovel/src/rabbit_shovel_sup.erl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ parse_configuration(_Defaults, [], Acc) ->
7070
parse_configuration(Defaults, [{ShovelName, ShovelConfig} | Env], Acc) when
7171
is_atom(ShovelName) andalso is_list(ShovelConfig)
7272
->
73-
rabbit_log:debug("rabbit_shovel:parse_configuration ~p ~p", [ShovelName, ShovelConfig]),
7473
case dict:is_key(ShovelName, Acc) of
7574
true ->
7675
{error, {duplicate_shovel_definition, ShovelName}};

deps/rabbitmq_shovel/src/rabbit_shovel_worker.erl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ init([Type, Name, Config0]) ->
5454
Config0),
5555
Conf
5656
end,
57-
rabbit_log:debug("Shovel config : ~p", [Config]),
5857
rabbit_log_shovel:debug("Initialising a Shovel ~ts of type '~ts'", [human_readable_name(Name), Type]),
5958
gen_server2:cast(self(), init),
6059
{ok, #state{name = Name, type = Type, config = Config}}.

deps/rabbitmq_shovel/test/configuration_SUITE.erl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
-compile(export_all).
1414

15-
-define(QUEUE, <<"test_queue">>).
15+
-define(QUEUE, <<"test_queue">>).
1616
-define(EXCHANGE, <<"test_exchange">>).
1717
-define(TO_SHOVEL, <<"to_the_shovel">>).
1818
-define(FROM_SHOVEL, <<"from_the_shovel">>).
@@ -307,7 +307,7 @@ setup_legacy_shovels(Config) ->
307307
setup_shovels(Config) ->
308308
ok = rabbit_ct_broker_helpers:rpc(Config, 0,
309309
?MODULE, setup_shovels1, [Config]).
310-
310+
311311
setup_legacy_shovels1(Config) ->
312312
_ = application:stop(rabbitmq_shovel),
313313
Hostname = ?config(rmq_hostname, Config),

deps/rabbitmq_shovel/test/shovel_test_utils.erl

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
-include_lib("common_test/include/ct.hrl").
1111
-export([set_param/3, set_param/4, set_param/5, set_param_nowait/3,
1212
await_shovel/2, await_shovel/3, await_shovel/4, await_shovel1/3,
13-
shovels_from_status/0, shovels_from_status/1, get_shovel_status/2, get_shovel_status/3,
13+
shovels_from_status/0, shovels_from_status/1,
14+
get_shovel_status/2, get_shovel_status/3,
1415
restart_shovel/2,
1516
await/1, await/2, clear_param/2, clear_param/3, make_uri/2]).
1617

@@ -53,21 +54,17 @@ await_shovel(Config, Node, Name, ExpectedState) ->
5354
?MODULE, await_shovel1, [Config, Name, ExpectedState]).
5455

5556
await_shovel1(_Config, Name, ExpectedState) ->
56-
rabbit_log:debug("await_shovel1 ~p on state ~p", [Name, ExpectedState]),
5757
Ret = await(fun() ->
5858
Status = shovels_from_status(ExpectedState),
59-
rabbit_log:debug("status=> ~p (~p)", [Status, ExpectedState]),
6059
lists:member(Name, Status)
6160
end, 30_000),
62-
rabbit_log:debug("await_shovel1 ~p on state ~p terminated", [Name, ExpectedState]),
6361
Ret.
6462

6563
shovels_from_status() ->
6664
shovels_from_status(running).
6765

6866
shovels_from_status(ExpectedState) ->
6967
S = rabbit_shovel_status:status(),
70-
rabbit_log:debug("Shovel status of state ~p: all status: ~p", [ExpectedState, S]),
7168
[N || {{<<"/">>, N}, dynamic, {State, _}, _} <- S, State == ExpectedState].
7269

7370
get_shovel_status(Config, Name) ->
@@ -94,7 +91,6 @@ await(Pred) ->
9491
await(_Pred, Timeout) when Timeout =< 0 ->
9592
error(await_timeout);
9693
await(Pred, Timeout) ->
97-
rabbit_log:debug("await:Checking predicate . timeout=~p",[Timeout]),
9894
case Pred() of
9995
true -> ok;
10096
Other when Timeout =< 100 ->

0 commit comments

Comments
 (0)