Remove binding from rabbit_index_route if exchange not found
This branch should never hit. However, if a source exchange is not present anymore, delete its bindings from rabbit_index_route. If the binding doesn't exist is rabbit_index_route, the delete operation is a no-op.
This commit is contained in:
parent
90d6a9d898
commit
f08171779e
|
|
@ -585,8 +585,8 @@ remove_routes(Routes, ShouldIndexTable) ->
|
|||
case rabbit_exchange:lookup(Src) of
|
||||
{ok, X} ->
|
||||
ok = sync_index_route(R, should_index_table(X), fun delete/3);
|
||||
_ ->
|
||||
ok
|
||||
{error, not_found} ->
|
||||
ok = sync_index_route(R, true, fun delete/3)
|
||||
end
|
||||
end || #route{binding = #binding{source = Src}} = R <- Routes]
|
||||
end,
|
||||
|
|
|
|||
Loading…
Reference in New Issue