Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B bull
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 175
    • Issues 175
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 9
    • Merge requests 9
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OptimalBits
  • bull
  • Issues
  • #915
Closed
Open
Issue created Apr 15, 2018 by Administrator@rootContributor

Prioritise delayed jobs

Created by: alexkh13

Description

When adding delayed jobs with priority to the queue, the priority is not affecting its placement in the waiting list.

Test code to reproduce

var normalPriority = [],
      highPriority = [];

highPriority.push(queue.add({p: 1}, {priority: 1, delay:2000}));

for(var i = 0; i < 4; i++){
   normalPriority.push(queue.add({p: 2}, {priority: 2}));
}

Promise.all(normalPriority, highPriority).then(function(){
   queue.process(function(job, jobDone){
      console.log(job.data.p);
      setTimeout(jobDone, 1000);
   });
});

The expected output of the above should be 2,2,1,2,2 But indeed we get 2,2,2,2,1

Bull version

Latest

Additional information

This is, of course, relevant to repeatable jobs as well

Assignee
Assign to
Time tracking