Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify what happens when adding job with duplicate id #941

Closed
imaGuru opened this issue Dec 15, 2021 · 4 comments
Closed

Clarify what happens when adding job with duplicate id #941

imaGuru opened this issue Dec 15, 2021 · 4 comments
Labels
question Further information is requested

Comments

@imaGuru
Copy link

imaGuru commented Dec 15, 2021

Description

Hi, I'm having trouble understanding documentation about duplicate jobIds.
The documentation has a giant red warning notice:

Jobs that are removed from the queue, either manually or when using settings such as removeOnComplete/Failed will not be considered as duplicates meaning that you can add the same job id many times over as long as the previous job has already been removed from the queue.

Isn't it tautological? Of course a job that is already removed will not be considered as a duplicate because it doesn't exist (duh!). But what happens when the job exists? If I understand correctly: when the job is in active/waiting state the new job to be added will be ignored, otherwise if the current job is failed it will not be considered as a duplicate, and a new job will replace it?

Or is it just me totally missing the mark?
Thanks!

Bull version

1.54.4

@manast
Copy link
Contributor

manast commented Dec 17, 2021

As long as there is a key in Redis with the jobId that job will not be added to the queue (i.e. it will be ignored, add will be a noop) independently in which state said job is in. The reason for the warning is to make it cristal clear that jobs that have been removed will not be affected by this.

@roggervalf roggervalf added the question Further information is requested label Dec 21, 2021
@imaGuru
Copy link
Author

imaGuru commented Dec 22, 2021

Ok, thanks for the clarification.

As for the warning, for me it was more confusing than helpful. It seemed redundant so I assumed it was just spelled out incorrectly and its meaning was supposed to be different.
If you think the warning is fine, then we can close this issue.

Anyway very nice library!

@roggervalf
Copy link
Collaborator

@giovanni-bertoncelli
Copy link

Is there a way to replace the job by the jobId?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants