Skip to content

Commit

Permalink
Remove errors for context cancelled (#243)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielle-tfh authored Dec 12, 2024
1 parent 0df1c8f commit 3b60d95
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ loop:
VisibilityTimeout: c.cfg.VisibilityTimeoutSeconds,
})
if err != nil {
if errors.Is(err, context.Canceled) {
// Suppress expected errors during shutdown
zap.S().Info("ReceiveMessage interrupted due to context cancellation")
continue
}
zap.S().With(zap.Error(err)).Error("could not receive messages from SQS")
continue
}
Expand Down

0 comments on commit 3b60d95

Please sign in to comment.