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

How to verify if a job was added to the queue? #1542

Closed
ppedziwiatr opened this issue Nov 20, 2022 · 3 comments
Closed

How to verify if a job was added to the queue? #1542

ppedziwiatr opened this issue Nov 20, 2022 · 3 comments

Comments

@ppedziwiatr
Copy link

ppedziwiatr commented Nov 20, 2022

Hey,

assuming that I'm adding jobs with custom jobIds (which can be duplicated) - how can I verify whether the job was actually added to the queue (after calling queue.add)?

The await queue.getJob(jobId) returns the job normally, even if the job should not be added to the queue (because of the duplicated id)

@roggervalf
Copy link
Collaborator

Hey @ppedziwiatr, there is an event "added" that is only triggered when a job is created without duplication

@ppedziwiatr
Copy link
Author

Thanks!

@ppedziwiatr
Copy link
Author

Btw., is there event that would allow me to determine that the queue rejected the job because of the duplicated jobId?

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

No branches or pull requests

2 participants