fix(GODT-3116): Panic on closed channel
If sync finishes during shutdown, check if there is a context error in the deferred go routine before rewinding the event.
This commit is contained in:
parent
ff288145df
commit
856bdd1321
|
@ -395,6 +395,11 @@ func (s *Service) run(ctx context.Context) { //nolint gocyclo
|
|||
// event service is unable to reply to the request until the events have been processed.
|
||||
s.log.Info("Sync complete, starting API event stream")
|
||||
go func() {
|
||||
// If context cancelled do not do anything
|
||||
if ctx.Err() != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if err := s.eventProvider.RewindEventID(ctx, s.lastHandledEventID); err != nil {
|
||||
if errors.Is(err, context.Canceled) {
|
||||
return
|
||||
|
|
Loading…
Reference in New Issue