diff options
author | Simon MacMullen <simon@rabbitmq.com> | 2011-04-06 15:23:04 +0100 |
---|---|---|
committer | Simon MacMullen <simon@rabbitmq.com> | 2011-04-06 15:23:04 +0100 |
commit | 4002f7243e0f392d6ceba4f779732f160321179e (patch) | |
tree | 64047fd4fc8bc663b586059fbc7213e3f5c7c731 /src/rabbit_binding.erl | |
parent | 6f9e91a2d0d38a1bcd680acbb4e2782d975c6a5d (diff) | |
download | rabbitmq-server-4002f7243e0f392d6ceba4f779732f160321179e.tar.gz |
Check the route still exists.
Diffstat (limited to 'src/rabbit_binding.erl')
-rw-r--r-- | src/rabbit_binding.erl | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/rabbit_binding.erl b/src/rabbit_binding.erl index d293c812..7131ab21 100644 --- a/src/rabbit_binding.erl +++ b/src/rabbit_binding.erl @@ -115,12 +115,15 @@ recover(XNames, QNames) -> none, rabbit_durable_route), ok. -should_recover(#binding{destination = Dst = #resource{ kind = Kind }}, +should_recover(B = #binding{destination = Dst = #resource{ kind = Kind }}, XNameSet, QNameSet) -> - sets:is_element(Dst, case Kind of - exchange -> XNameSet; - queue -> QNameSet - end). + case mnesia:read({rabbit_durable_route, B}) of + [] -> false; %% It disappeared between getting the list and here + [_] -> sets:is_element(Dst, case Kind of + exchange -> XNameSet; + queue -> QNameSet + end) + end. exists(Binding) -> binding_action( |