Skip to content

Commit

Permalink
chore: added missing return statement when subscription cancled (dyme…
Browse files Browse the repository at this point in the history
  • Loading branch information
mtsitrin authored Oct 1, 2023
1 parent 17e8622 commit 9e596df
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion block/synctarget.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ func (m *Manager) SyncTargetLoop(ctx context.Context) {
// TODO(omritoptix): Check if we are the aggregator
m.batchInProcess.Store(false)
case <-subscription.Cancelled():
m.logger.Info("Subscription canceled")
m.logger.Info("syncTargetLoop subscription canceled")
return
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion settlement/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ func (b *BaseLayerClient) stateUpdatesHandler(ready chan bool) {
utils.SubmitEventOrPanic(b.ctx, b.pubsub, newBatchEventData,
map[string][]string{EventTypeKey: {EventNewBatchAccepted}})
case <-subscription.Cancelled():
b.logger.Info("subscription canceled")
b.logger.Info("stateUpdatesHandler subscription canceled")
return
case <-b.ctx.Done():
b.logger.Info("Context done. Exiting state update handler")
Expand Down
3 changes: 2 additions & 1 deletion utils/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ func SubscribeAndHandleEvents(ctx context.Context, pubsubServer *pubsub.Server,
case event := <-subscription.Out():
callback(event)
case <-subscription.Cancelled():
logger.Info("Subscription canceled")
logger.Info(clientID + " subscription canceled")
return
}
}
}
Expand Down

0 comments on commit 9e596df

Please sign in to comment.