Skip to content

Commit 078d457

Browse files
committed
Remove unused code/variables
[#154472158]
1 parent 063d3bb commit 078d457

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

src/rabbit_amqqueue.erl

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ warn_file_limit() ->
232232
recover(VHost) ->
233233
Queues = find_durable_queues(VHost),
234234
{Classic, Quorum} = filter_per_type(Queues),
235-
recover_classic_queues(VHost, Classic) ++ recover_quorum_queues(VHost, Quorum).
235+
recover_classic_queues(VHost, Classic) ++ recover_quorum_queues(Quorum).
236236

237237
recover_classic_queues(VHost, Queues) ->
238238
{ok, BQ} = application:get_env(rabbit, backing_queue_module),
@@ -249,9 +249,9 @@ recover_classic_queues(VHost, Queues) ->
249249
throw({error, Reason})
250250
end.
251251

252-
recover_quorum_queues(VHost, Queues) ->
252+
recover_quorum_queues(Queues) ->
253253
[begin
254-
ok = ra:restart_node(ra_node_config(VHost, Id)),
254+
ok = ra:restart_node(ra_node_config(Id)),
255255
internal_declare(Q, true)
256256
end || #amqqueue{pid = Id} = Q <- Queues].
257257

@@ -399,16 +399,16 @@ declare_classic_queue(QueueName, Q, VHost, Node) ->
399399
[rabbit_misc:rs(QueueName), Node1, Error])
400400
end.
401401

402-
declare_quorum_queue(QueueName, #amqqueue{vhost = VHost} = Q) ->
402+
declare_quorum_queue(QueueName, Q) ->
403403
RaName = qname_to_rname(QueueName),
404404
Id = {RaName, node()},
405405
NewQ = Q#amqqueue{pid = Id},
406-
ok = ra:start_node(ra_node_config(VHost, Id)),
406+
ok = ra:start_node(ra_node_config(Id)),
407407
_ = ra_node_proc:trigger_election(Id),
408408
internal_declare(NewQ, false),
409409
{new, NewQ}.
410410

411-
ra_node_config(VHost, {Name, _} = Id) ->
411+
ra_node_config({Name, _} = Id) ->
412412
{ok, DataDir} = application:get_env(ra, data_dir),
413413
UId = atom_to_binary(Name, utf8),
414414
#{id => Id,
@@ -419,11 +419,6 @@ ra_node_config(VHost, {Name, _} = Id) ->
419419
initial_nodes => [],
420420
machine => {module, ra_fifo}}.
421421

422-
vhost_dir(<<"/">>) ->
423-
"%2F";
424-
vhost_dir(Other) ->
425-
binary_to_list(Other).
426-
427422
%% TODO escape hack
428423
qname_to_rname(#resource{virtual_host = <<"/">>, name = Name}) ->
429424
erlang:binary_to_atom(<<"%2F_", Name/binary>>, utf8);
@@ -846,7 +841,7 @@ i_quorum(messages_ready, #amqqueue{pid = {Name, _}}) ->
846841
i_quorum(messages_unacknowledged, #amqqueue{pid = {Name, _}}) ->
847842
[{_, _, Checkout, Settle, Return}] = ets:lookup(ra_fifo_metrics, Name),
848843
Checkout - Settle - Return;
849-
i_quorum(K, _Q) -> ''.
844+
i_quorum(_K, _Q) -> ''.
850845

851846
quorum_messages(Name) ->
852847
[{_, Enqueue, _, Settle, _}] = ets:lookup(ra_fifo_metrics, Name),
@@ -1031,7 +1026,8 @@ credit(#amqqueue{pid = QPid}, ChPid, CTag, Credit, Drain) ->
10311026

10321027
basic_get(#amqqueue{pid = QPid, type = classic}, ChPid, NoAck, LimiterPid) ->
10331028
delegate:invoke(QPid, {gen_server2, call, [{basic_get, ChPid, NoAck, LimiterPid}, infinity]});
1034-
basic_get(#amqqueue{name = QName, pid = {Name, _} = Id, type = quorum}, ChPid, NoAck, LimiterPid) ->
1029+
basic_get(#amqqueue{name = QName, pid = {Name, _} = Id, type = quorum}, _ChPid, NoAck,
1030+
_LimiterPid) ->
10351031
ra:send_and_await_consensus(Id, {checkout, get, self()}),
10361032
receive
10371033
{ra_event, _, machine, {msg, _, empty}} ->

0 commit comments

Comments
 (0)