Skip to content

Question: Wait instead of cancelling if it is executing? #655

@ghost

Description

Hi,

I am sorry in advance if it is inappropriate to ask questions here. I was wondering if anyone could point me in the right direction to create this behavior:

Let's say I queue MyJob(param=123). I cannot re-queue MyJob(param=123) until it is executing(in-progress). (Behavior of until_executing). The edge case here is while MyJob(param=123) is executing, it should be able to queue again the same job, but it should wait until the first MyJob(param=123) is done before running the second instance with the same param.

According to the doc, there is a on_conflict: :reschedule, however it's not exactly this behavior I am looking for. The correct behavior would be :

:reject if job with same param is already queued
:reschedule if job with same param is running and there is not another one in the queue.

Thanks in advance :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions