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

smarter short snooze times #162

Merged
merged 1 commit into from
Jan 19, 2024
Merged

smarter short snooze times #162

merged 1 commit into from
Jan 19, 2024

Conversation

bgentry
Copy link
Contributor

@bgentry bgentry commented Jan 19, 2024

Normally, snoozed jobs are set scheduled for the future and it's the scheduler's job to set them back to available so they can be reworked. Just as with retryable jobs, this isn't friendly for short snooze times so we can instead make the job immediately available if the snooze time is smaller than the scheduler's run interval.

We have an identical behavior for errored/retryable jobs for the same reason.

@bgentry bgentry requested a review from brandur January 19, 2024 04:45
Normally, snoozed jobs are set `scheduled` for the future and it's the
scheduler's job to set them back to `available` so they can be reworked.
Just as with retryable jobs, this isn't friendly for short snooze times
so we instead make the job immediately `available` if the snooze time is
smaller than the scheduler's run interval.

We have an identical behavior for errored/retryable jobs for the same
reason.
@bgentry bgentry force-pushed the bg-smarter-short-snoozing branch from baa1eaf to 2e09403 Compare January 19, 2024 04:47
Copy link
Contributor

@brandur brandur left a comment

Choose a reason for hiding this comment

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

Sweet. Yep, makes sense.

@bgentry bgentry merged commit dc90985 into master Jan 19, 2024
7 checks passed
@bgentry bgentry deleted the bg-smarter-short-snoozing branch January 19, 2024 15:28
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