Handling priority of jobs with retries (oldest created over oldest enqueued)

Hi,

we use hangfire with batches and we faced an “issue”.

We have multiple batches with thousands of jobs that call an API so they can fail very often, jobs in batches use the same queue (they are the same job).

When a job (J1) of a batch (B1) fail it goes to “retries” and wait for a couple of minutes; if a new batch (B2) is submitted before J1 is reenqueued then all the jobs of B2 are resolved before J1 (unless they fail and goes to retries).

This leads to the fact that if B1 misses a couple of jobs it have to wait for B2 to complete.

I wonder if would be possible to add a configuration that, when a worker process is free and have to choose a job to process it will choose the oldest created job and not the oldest enqueued all applied after Queues priority.

Really appreciate your work!

@MauSamba do you have news about this question?

I have the same situation

@shashi_kant no news
I opened the issue #2214 on github