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
  • #807
Closed
Open
Issue created Dec 04, 2017 by Administrator@rootContributor

Adding new job after second removal with removeRepeatable fails

Created by: tdzienniak

Code ilustrating the issue:

const Queue = require('bull');
const testQueue = new Queue('test');

testQueue.process(function(job) {
  console.log('Work, work!');
});

const init = async () => {
  await testQueue.add('myTestJob', {
    data: '1',
  }, {
    repeat: {
      cron: '* * * * *',
    },
  });

  console.log((await testQueue.getDelayed()).length); // 1

  await testQueue.removeRepeatable('myTestJob', {
    cron: '* * * * *'
  })

  console.log((await testQueue.getDelayed()).length); // 0

  await testQueue.add('myTestJob', {
    data: '2',
  }, {
    repeat: {
      cron: '*/5 * * * *',
    },
  });

  console.log((await testQueue.getDelayed()).length); // 1

  await testQueue.removeRepeatable('myTestJob', {
    cron: '*/5 * * * *'
  })

  console.log((await testQueue.getDelayed()).length); // 0

  await testQueue.add('myTestJob', {
    data: '2',
  }, {
    repeat: {
      cron: '*/5 * * * *',
    },
  });

  console.log((await testQueue.getDelayed()).length); // 0, but should be one
}

init();

As you can see, after first removal with removeRepeatable job is added just fine, but after seconde removal job is not added at all. This is very critical issue in my use case.

Assignee
Assign to
Time tracking