Skip to content

Commit

Permalink
fix for potential race condition
Browse files Browse the repository at this point in the history
  • Loading branch information
bwolf200 committed Aug 20, 2024
1 parent d0ea5fd commit d2b5ccc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/pkg/tablemgr/routing_table_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,9 @@ func (r *DefaultRoutingTableManager) RemoveRoute(ctx context.Context, tid tenant
}

func (r *DefaultRoutingTableManager) RouteEvent(ctx context.Context, tid tenant.Id, routeId string, payload interface{}) (*event.Event, string, error) {
r.Lock()
lrw, ok := r.liveRouteMap[tid.KeyWithRoute(routeId)]
r.Unlock()
if !ok {
return nil, "", errors.New("no route " + routeId)
}
Expand Down

0 comments on commit d2b5ccc

Please sign in to comment.