diff options
| author | Ayanda-D <ayanda.dube@erlang-solutions.com> | 2020-06-04 12:12:41 +0100 |
|---|---|---|
| committer | Michael Klishin <michael@clojurewerkz.org> | 2020-09-02 04:28:57 +0300 |
| commit | 1250cf2c45a2cc86fae8ae93558498b550971a10 (patch) | |
| tree | 61ee5c5bded906e6523a0eb041a7af57c22c4250 | |
| parent | a990345805491b69965a71a546b0c6baab35c069 (diff) | |
| download | rabbitmq-server-git-1250cf2c45a2cc86fae8ae93558498b550971a10.tar.gz | |
Update per-vhost connection count references to new API
| -rw-r--r-- | src/rabbit_connection_tracking_handler.erl | 1 | ||||
| -rw-r--r-- | src/rabbit_vhost_limit.erl | 3 | ||||
| -rw-r--r-- | test/per_vhost_connection_limit_SUITE.erl | 2 | ||||
| -rw-r--r-- | test/per_vhost_connection_limit_partitions_SUITE.erl | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/src/rabbit_connection_tracking_handler.erl b/src/rabbit_connection_tracking_handler.erl index a75defbcef..8b9e44445f 100644 --- a/src/rabbit_connection_tracking_handler.erl +++ b/src/rabbit_connection_tracking_handler.erl @@ -22,7 +22,6 @@ -export([close_connections/3]). -include_lib("rabbit.hrl"). --import(rabbit_misc, [pget/2]). -rabbit_boot_step({?MODULE, [{description, "connection tracking event handler"}, diff --git a/src/rabbit_vhost_limit.erl b/src/rabbit_vhost_limit.erl index ce5532ba54..7f125e442d 100644 --- a/src/rabbit_vhost_limit.erl +++ b/src/rabbit_vhost_limit.erl @@ -90,7 +90,8 @@ is_over_connection_limit(VirtualHost) -> %% with limit = 0, no connections are allowed {ok, 0} -> {true, 0}; {ok, Limit} when is_integer(Limit) andalso Limit > 0 -> - ConnectionCount = rabbit_connection_tracking:count_connections_in(VirtualHost), + ConnectionCount = + rabbit_connection_tracking:count_tracked_items({vhost, VirtualHost}), case ConnectionCount >= Limit of false -> false; true -> {true, Limit} diff --git a/test/per_vhost_connection_limit_SUITE.erl b/test/per_vhost_connection_limit_SUITE.erl index f3e37b0a0c..a0ecbf43ea 100644 --- a/test/per_vhost_connection_limit_SUITE.erl +++ b/test/per_vhost_connection_limit_SUITE.erl @@ -137,7 +137,7 @@ clear_all_connection_tracking_tables(Config) -> [rabbit_ct_broker_helpers:rpc(Config, N, rabbit_connection_tracking, - clear_tracked_connection_tables_for_this_node, + clear_tracking_tables, []) || N <- rabbit_ct_broker_helpers:get_node_configs(Config, nodename)]. %% ------------------------------------------------------------------- diff --git a/test/per_vhost_connection_limit_partitions_SUITE.erl b/test/per_vhost_connection_limit_partitions_SUITE.erl index e4c6864ea0..aa190d1f7a 100644 --- a/test/per_vhost_connection_limit_partitions_SUITE.erl +++ b/test/per_vhost_connection_limit_partitions_SUITE.erl @@ -140,7 +140,7 @@ count_connections_in(Config, VHost) -> count_connections_in(Config, VHost, NodeIndex) -> rabbit_ct_broker_helpers:rpc(Config, NodeIndex, rabbit_connection_tracking, - count_connections_in, [VHost]). + count_tracked_items, [{vhost, VHost}]). connections_in(Config, VHost) -> connections_in(Config, 0, VHost). |
