Skip to content

Commit

Permalink
Prepare for adding more checks
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonUnge committed May 14, 2024
1 parent 608be08 commit 46af406
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion deps/rabbit/src/rabbit_queue_type.erl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
%%

-module(rabbit_queue_type).
-feature(maybe_expr, enable).

-behaviour(rabbit_registry_class).

Expand Down Expand Up @@ -307,7 +308,7 @@ is_compatible(Type, Durable, Exclusive, AutoDelete) ->
declare(Q0, Node) ->
Q = rabbit_queue_decorator:set(rabbit_policy:set(Q0)),
Mod = amqqueue:get_type(Q),
case check_vhost_queue_limit(Q) of
case check_queue_limits(Q) of
ok ->
Mod:declare(Q, Node);
Error ->
Expand Down Expand Up @@ -771,6 +772,12 @@ known_queue_type_names() ->
QTypeBins = lists:map(fun(X) -> atom_to_binary(X) end, QueueTypes),
?KNOWN_QUEUE_TYPES ++ QTypeBins.

check_queue_limits(Q) ->
maybe
%% Prepare for more checks
ok ?= check_vhost_queue_limit(Q)
end.

check_vhost_queue_limit(Q) ->
#resource{name = QueueName} = amqqueue:get_name(Q),
VHost = amqqueue:get_vhost(Q),
Expand Down

0 comments on commit 46af406

Please sign in to comment.