Skip to content

Commit 468dc77

Browse files
author
Gabriele Santomaggio
committed
Change format for Limits API
1 parent becd93d commit 468dc77

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

src/rabbit_vhost_limit.erl

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
-export([update_limit/3, clear_limit/2, get_limit/2]).
2727
-export([validate/5, notify/4, notify_clear/3]).
2828
-export([connection_limit/1, queue_limit/1,
29-
is_over_queue_limit/1, is_over_connection_limit/1]).
29+
is_over_queue_limit/1, is_over_connection_limit/1]).
3030

3131
-import(rabbit_misc, [pget/2, pget/3]).
3232

@@ -59,21 +59,26 @@ connection_limit(VirtualHost) ->
5959
queue_limit(VirtualHost) ->
6060
get_limit(VirtualHost, <<"max-queues">>).
6161

62-
-spec list() -> [{rabbit_types:vhost(), rabbit_types:infos()}].
6362

64-
list() ->
65-
case rabbit_runtime_parameters:list_component(<<"vhost-limits">>) of
63+
list0(VHost) ->
64+
case rabbit_runtime_parameters:list(VHost, <<"vhost-limits">>) of
6665
[] -> [];
6766
Params -> [ {pget(vhost, Param), pget(value, Param)}
68-
|| Param <- Params,
69-
pget(value, Param) =/= undefined,
70-
pget(name, Param) == <<"limits">> ]
67+
|| Param <- Params,
68+
pget(value, Param) =/= undefined,
69+
pget(name, Param) == <<"limits">> ]
7170
end.
7271

72+
73+
-spec list() -> [{rabbit_types:vhost(), rabbit_types:infos()}].
74+
75+
list() -> list0('_').
76+
77+
7378
-spec list(rabbit_types:vhost()) -> rabbit_types:infos().
7479

75-
list(VHost) ->
76-
rabbit_runtime_parameters:value(VHost, <<"vhost-limits">>, <<"limits">>, []).
80+
list(VHost) -> list0(VHost).
81+
7782

7883
-spec is_over_connection_limit(rabbit_types:vhost()) -> {true, non_neg_integer()} | false.
7984

0 commit comments

Comments
 (0)