summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Klishin <mklishin@pivotal.io>2019-04-13 00:36:03 +0400
committerMichael Klishin <michael@clojurewerkz.org>2019-04-13 01:11:13 +0400
commitdc3c04ffc3862d89d24f55594ae62ab0f8747fdd (patch)
tree6e9277e88323f623fa69063790d1a8c2f42acccb /src
parentb5c62a5a56843c5c651fe7fc532c4f4ba6764aa0 (diff)
downloadrabbitmq-server-git-dc3c04ffc3862d89d24f55594ae62ab0f8747fdd.tar.gz
Introduce rabbit_vhost:count/0
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_vhost.erl6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/rabbit_vhost.erl b/src/rabbit_vhost.erl
index 80b726b4bb..8ab5a09725 100644
--- a/src/rabbit_vhost.erl
+++ b/src/rabbit_vhost.erl
@@ -21,7 +21,7 @@
%%----------------------------------------------------------------------------
-export([recover/0, recover/1]).
--export([add/2, delete/2, exists/1, list/0, with/2, with_user_and_vhost/3, assert/1, update/2,
+-export([add/2, delete/2, exists/1, list/0, count/0, with/2, with_user_and_vhost/3, assert/1, update/2,
set_limits/2, limits_of/1, vhost_cluster_state/1, is_running_on_all_nodes/1, await_running_on_all_nodes/2]).
-export([info/1, info/2, info_all/0, info_all/1, info_all/2, info_all/3]).
-export([dir/1, msg_store_dir_path/1, msg_store_dir_wildcard/0]).
@@ -241,6 +241,10 @@ exists(VHostPath) ->
list() ->
mnesia:dirty_all_keys(rabbit_vhost).
+-spec count() -> non_neg_integer().
+count() ->
+ length(list()).
+
-spec with(rabbit_types:vhost(), rabbit_misc:thunk(A)) -> A.
with(VHostPath, Thunk) ->