Customize retry policy based on the error? #978
Unanswered
stargeneration-winston
asked this question in
Q&A
Replies: 1 comment 4 replies
-
Check out the docs on custom retry policies. There's an example of exactly what you're looking for here: https://riverqueue.com/docs/job-retries#client-retry-policy // NextRetry returns the next retry time based on the non-generic JobRow
// which includes an up-to-date Errors list.
func (policy *LinearRetryPolicy) NextRetry(job *rivertype.JobRow) time.Time {
// The latest error is not yet included in the job's Errors list, so we
// add 1 to the length to account for that.
return time.Now().Add((len(job.Errors) + 1) * 5 * time.Second)
} |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Is there a way to differentiate the retry policy on the error encountered? e.g. external service connection error should trigger immediate retry, while a input args error should wait a few hours for user to respond
Beta Was this translation helpful? Give feedback.
All reactions