'waiting' event is not emitted for priority job
Created by: btd
Consider such basic code:
"use strict";
const Queue = require("bull");
const q = new Queue("test");
q.on("error", function(error) {
console.log("error");
})
.on("waiting", function(jobId) {
console.log("waiting");
})
.on("active", function(job, jobPromise) {
console.log("active");
})
.on("stalled", function(job) {
console.log("stalled");
})
.on("progress", function(job, progress) {
console.log("progress");
})
.on("completed", function(job, result) {
console.log("completed");
})
.on("failed", function(job, err) {
console.log("failed");
})
.on("paused", function() {
console.log("paused");
})
.on("resumed", function(job) {
console.log("resumed");
})
.on("cleaned", function(jobs, type) {
console.log("cleaned");
})
.on("drained", function() {
console.log("drained");
})
.on("removed", function(job) {
console.log("removed");
});
q.process("*", 1, () => {
console.log("EXECUTING");
});
q.add({});
q.add({}, { priority: 100 });
As output you will see:
waiting
EXECUTING
active
completed
EXECUTING
active
completed
drained
Bull version
$ npm ls bull
ingo-app-tasks@4.5.0 /dir
└── bull@3.4.8