Skip to content

[FEATURE REQUEST] Support setting retry delay when inserting a new job #615

@rhodeon

Description

@rhodeon

I'm integrating River as part of a bigger task system, and it's been great so far. But there's a particular missing feature that would be nice to have.
Currently, we are able to specify the maximum attempts of retries at both the worker and job level (https://riverqueue.com/docs/job-retries#limiting-retry-attempts):

_, err = riverClient.Insert(ctx, RetryOnceJobArgs{}, &river.InsertOpts{
    // use a max attempts of 5 for this one job even though the job has a
    // default limit of 1:
    MaxAttempts: 5,
})

On the other hand, the job retry delays can be set at the client and worker level (https://riverqueue.com/docs/job-retries#retry-delays), but not at the job level.
It would be great to be able to set the retry delay at job insertion, just like how the maximum attempt is.
A use-case for us is that users are able to create "rules" that control the dispatching of jobs to workers, and these rules can have their max attempts/delays customised.
Is this feature something that can be considered, or even feasible with the current River architecture?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions