Globally paused queue cannot receive job (or not shown in Arena untill queue is globally resumed)
Created by: 11arn11
Description
I use Arena as a GUI
I have two workers and two queues
The worker of the first queue fills the second queue.
The second worker must start paused.
When the first worker finishes his queue, he has to resume the second one.
Now the problem...
If the second worker starts globally paused, Arena does not show the jobs added to the queue until the second queue is resumed
If the second worker starts locally paused, Arena will show the jobs added to this second queue, but the first worker will not be able to restart th second queue (according to the documentation)
how can I do?
Worker 1
const Queue = require('bull');
const queue_1_1 = new Queue('queue1');
const queue_1_2 = new Queue('queue2');
(async function () {
await queue_1_1.pause();
queue_1_1.process(function (job, done) {
if (something) {
queue_1_2.resume();
}
console.log(job.data);
done();
});
})();
Worker 2
const Queue = require('bull');
const queue_2_2 = new Queue('queue2');
(async function () {
// pause globally
// in this way, Arena will not show the jobs of queue 2 until queue 2 is resumed
queue_2_2.pause();
// paused locally
// in this way I will not be able to restart the second queue externally
// queue_2_2.pause(true);
queue_2_2.process(function (job, done) {
console.log(job.data);
done();
});
})();