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
  • #601
Closed
Open
Issue created Jul 03, 2017 by Administrator@rootContributor

Add multiple repeatable jobs with the same cron pattern

Created by: Maximization

In my use case I have multiple repeatable jobs with the same cron pattern that are created and removed programatically. I do not know beforehand how many jobs will be at any given time.

According to this line https://github.com/OptimalBits/bull/blob/master/lib/queue.js#L506 the uniqueness of repeatable job keys is determined by the prefix, queue name, 'repeat', job name and cron string. Which means I can only try and differentiate the keys with the queue or job name variables, both for which I need to instantiate separate queue workers to process them. This works well when the jobs are predefined before but is less convenient when jobs are added and removed on the go.

If I try to add multiple jobs with the same cron pattern they get the same key and therefore only one will exist at a given time. JobId seems to not play a role with repeatable jobs.

Is there a way to accomplish this or a workaround for the existing code?

Assignee
Assign to
Time tracking