Get instance of queue from worker process #1722
Unanswered
mattweberio
asked this question in
Q&A
Replies: 1 comment 2 replies
-
Are you connecting to the same Redis host? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
We must drain the queue if a job fails because every job depends on the previous job.
I've tried to get a reference to the Queue from inside the worker to execute the drain method.
e.g.
const queue = new Queue(sessionId)
But it appears to create a new instance and does not connect to the same queue. For example, when I call drain(), it doesn't work, and getActiveCount() always returns 0.
What is the correct way to clear the queue of all jobs if one job fails?
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions