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:
David Ansari 2022-07-29 09:14:17 +00:00
parent 90d6a9d898
commit f08171779e
1 changed files with 2 additions and 2 deletions

View File

@ -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,