-
I'm using river queues in the context of scheduling, and since the worker queue for the scheduler is customizable, it might be the case that we want to continue trying (with some backoff) greater than some integer value. Would it be possible to have some value like -1 that essentially says "There is no maxAttempts, keep trying until the end of the time?" If not, I would choose some maximum integer value, but it would be nice to be able to explicitly say that in the code. Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The database column is an int16 so at the very least you’re limited to the max positive value of that. However it’s probably not a good idea to retry a single job indefinitely due to the nature of how River stores job results in a jsonb column. That would start to get pretty large to keep updating & rewriting it. Another option is to have your jobs snooze instead of erroring when they need to try again later due to some predictable reason. Although as of now the attempt count keeps being incremented on snooze so you would encounter the same limit there too. |
Beta Was this translation helpful? Give feedback.
The database column is an int16 so at the very least you’re limited to the max positive value of that. However it’s probably not a good idea to retry a single job indefinitely due to the nature of how River stores job results in a jsonb column. That would start to get pretty large to keep updating & rewriting it.
Another option is to have your jobs snooze instead of erroring when they need to try again later due to some predictable reason. Although as of now the attempt count keeps being incremented on snooze so you would encounter the same limit there too.