Skip to content

Commit

Permalink
loop: do not error out on context done in the executor
Browse files Browse the repository at this point in the history
  • Loading branch information
bhandras committed Dec 12, 2024
1 parent d198bb8 commit a107036
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ func (s *executor) run(mainCtx context.Context,
defer s.wg.Done()

err := s.batcher.Run(mainCtx)
if err != nil {
if err != nil && !errors.Is(err, context.Canceled) {
select {
case batcherErrChan <- err:
case <-mainCtx.Done():
Expand Down Expand Up @@ -229,10 +229,10 @@ func (s *executor) run(mainCtx context.Context,
}

case err := <-blockErrorChan:
return fmt.Errorf("block error: %v", err)
return fmt.Errorf("block error: %w", err)

case err := <-batcherErrChan:
return fmt.Errorf("batcher error: %v", err)
return fmt.Errorf("batcher error: %w", err)

case <-mainCtx.Done():
return mainCtx.Err()
Expand Down

0 comments on commit a107036

Please sign in to comment.