Only emit the events when actually deleting the route
This commit is contained in:
parent
f50bd400f8
commit
4f788c6fc7
@ -83,8 +83,10 @@ func (t *table) Delete(r Route) error {
|
||||
return ErrRouteNotFound
|
||||
}
|
||||
|
||||
delete(t.routes[service], sum)
|
||||
go t.sendEvent(&Event{Type: Delete, Timestamp: time.Now(), Route: r})
|
||||
if _, ok := t.routes[service][sum]; ok {
|
||||
delete(t.routes[service], sum)
|
||||
go t.sendEvent(&Event{Type: Delete, Timestamp: time.Now(), Route: r})
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user