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

Feature request: Including failed jobs in QueueEvents "failed" #1038

Closed
hardcodet opened this issue Jan 30, 2022 · 3 comments · Fixed by #1043
Closed

Feature request: Including failed jobs in QueueEvents "failed" #1038

hardcodet opened this issue Jan 30, 2022 · 3 comments · Fixed by #1043

Comments

@hardcodet
Copy link

I'm migrating from Bull to BullMQ and was wondering on how to handle failed jobs without establishing a worker for every single job. On Bull, I just picked them off the Queue, and the new QueueEvents class seems to be the logical successor. However, it only gives me the job's ID rather than the Job itself, which is just a random ID.

Given that Bull could do it, wouldn't it make sense to submit the Job as well? In the past, we would have logged the whole job, which would have allowed us to diagnose the context of about what happened. Should (can?) we now retrieve the job in a subsequent call? This feels problematic as well given that things already went sideways... :)

@manast
Copy link
Contributor

manast commented Jan 30, 2022

If you listen to the failed event from a worker instance you will also get the job instance that failed.

@hardcodet
Copy link
Author

hardcodet commented Jan 30, 2022

Done, thanks for the quick turnaround!

FYI: The documentation on https://docs.bullmq.io/guide/workers indicates that the second parameter of the worker's failed event was a failedReason string, but it's the actual error (which is great).

@github-actions
Copy link

github-actions bot commented Feb 3, 2022

🎉 This issue has been resolved in version 1.68.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging a pull request may close this issue.

2 participants