Skip to content

'waiting' event is not emitted for priority job #1134

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

Closed
btd opened this issue Nov 18, 2018 · 3 comments
Closed

'waiting' event is not emitted for priority job #1134

btd opened this issue Nov 18, 2018 · 3 comments

Comments

@btd
Copy link
Contributor

btd commented Nov 18, 2018

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
@btd
Copy link
Contributor Author

btd commented Nov 18, 2018

I think missing second call for publish in addJob lua script like in this line https://github.com/OptimalBits/bull/blob/develop/lib/commands/addJob-6.lua#L84

@manast manast added the bug label Nov 21, 2018
seriallos added a commit to seriallos/bull that referenced this issue Apr 26, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@abdatta
Copy link

abdatta commented Jul 9, 2020

Any updates on this bug? I'm facing issue with this :(

@stale
Copy link

stale bot commented Jul 12, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Jul 12, 2021
@manast manast closed this as completed Jul 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants