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

tweak JobRetry to reset ScheduledAt in most cases #211

Merged
merged 1 commit into from
Feb 18, 2024

Conversation

bgentry
Copy link
Contributor

@bgentry bgentry commented Feb 18, 2024

This is a small change in behavior on #190.

A job which has already completed will have a ScheduledAt that could be long in the past. Now that we're re-scheduling it, we should update that to the current time to slot it in alongside other recently-scheduled jobs and not skip the line. Also, its wait duration can't be calculated accurately if we don't reset the ScheduledAt (it could show days of wait time even if it was picked up immediately after being retried).

The only time we will continue to avoid touching ScheduledAt here is for an already-available job with a ScheduledAt in the past.

@bgentry bgentry requested a review from brandur February 18, 2024 22:11
A job which has already completed will have a ScheduledAt that could be
long in the past. Now that we're re-scheduling it, we should update that
to the current time to slot it in alongside other recently-scheduled
jobs and not skip the line. Also, its wait duration can't be calculated
accurately if we don't reset the ScheduledAt (it could show days of wait
time even if it was picked up immediately after being retried).
@bgentry bgentry force-pushed the bg-job-retry-immediately-fix branch from f4cc249 to 9fc772a Compare February 18, 2024 22:14
@bgentry bgentry merged commit 985e684 into master Feb 18, 2024
10 checks passed
@bgentry bgentry deleted the bg-job-retry-immediately-fix branch February 18, 2024 22:44
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