Skip to content

Commit e8a8d90

Browse files
committed
Report vhost status on vhost info
rabbitmq-management#446 [#149398495]
1 parent e66809b commit e8a8d90

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/rabbit_vhost.erl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ recover(VHost) ->
7373

7474
%%----------------------------------------------------------------------------
7575

76-
-define(INFO_KEYS, [name, tracing]).
76+
-define(INFO_KEYS, [name, tracing, state]).
7777

7878
add(VHostPath, ActingUser) ->
7979
rabbit_log:info("Adding vhost '~s'~n", [VHostPath]),
@@ -253,6 +253,10 @@ infos(Items, X) -> [{Item, i(Item, X)} || Item <- Items].
253253

254254
i(name, VHost) -> VHost;
255255
i(tracing, VHost) -> rabbit_trace:enabled(VHost);
256+
i(state, VHost) -> case rabbit_vhost_sup_sup:is_vhost_alive(VHost) of
257+
true -> running;
258+
false -> down
259+
end;
256260
i(Item, _) -> throw({bad_argument, Item}).
257261

258262
info(VHost) -> infos(?INFO_KEYS, VHost).

0 commit comments

Comments
 (0)