Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix : do not log cancellation errors in worker jobs #6540

Merged
merged 2 commits into from
Feb 3, 2025

Conversation

k-anshul
Copy link
Member

No description provided.

@k-anshul k-anshul self-assigned this Jan 30, 2025
@@ -107,7 +108,7 @@ func (w *Worker) RunJob(ctx context.Context, name string) error {
func (w *Worker) schedule(ctx context.Context, name string, fn func(context.Context) error, every time.Duration) error {
for {
err := w.runJob(ctx, name, fn)
if err != nil {
if err != nil && !errors.Is(err, context.Canceled) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about line 156?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is getting logged twice so I removed that log and added handling somewhere else as well.

@begelundmuller begelundmuller merged commit 8a22a74 into main Feb 3, 2025
7 checks passed
@begelundmuller begelundmuller deleted the dont_log_cancellation_errors branch February 3, 2025 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants