diff options
| author | Daniil Fedotov <dfedotov@pivotal.io> | 2017-07-28 15:35:18 +0100 |
|---|---|---|
| committer | Daniil Fedotov <dfedotov@pivotal.io> | 2017-07-31 12:18:00 +0100 |
| commit | 636a1d8fb2e2c1722a4dda11cad481d4f8e02c51 (patch) | |
| tree | 708128dde62d1aeb242e3da0b3be67f910e5b1e5 | |
| parent | e9fb778418ebb58e02079d78b41185fc05df61bd (diff) | |
| download | rabbitmq-server-git-636a1d8fb2e2c1722a4dda11cad481d4f8e02c51.tar.gz | |
Consider vhost can be deleted when cleaning vhost limits.
During the vhost delete operation runtime parameters cleanup
happens after vhost is deleted, so `notify_clear` should not
fail if vhost does not exist anymore.
| -rw-r--r-- | src/rabbit_vhost_limit.erl | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/rabbit_vhost_limit.erl b/src/rabbit_vhost_limit.erl index 7b797e46b2..9d8a6795b4 100644 --- a/src/rabbit_vhost_limit.erl +++ b/src/rabbit_vhost_limit.erl @@ -55,7 +55,12 @@ notify(VHost, <<"vhost-limits">>, <<"limits">>, Limits, ActingUser) -> notify_clear(VHost, <<"vhost-limits">>, <<"limits">>, ActingUser) -> rabbit_event:notify(vhost_limits_cleared, [{name, <<"limits">>}, {user_who_performed_action, ActingUser}]), - update_vhost(VHost, undefined). + %% If the function is called as a part of vhost deletion, the vhost can + %% be already deleted. + case rabbit_vhost:exists(VHost) of + true -> update_vhost(VHost, undefined); + false -> ok + end. connection_limit(VirtualHost) -> get_limit(VirtualHost, <<"max-connections">>). |
