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
  • #1676
Closed
Open
Issue created Mar 16, 2020 by Administrator@rootContributor

Remove repeatable jobs does not remove the next repeatable job

Created by: KidkArolis

Here's my queue state in redis after adding repeatable jobs to the queue:

127.0.0.1:6379> keys *
1) "hmns:dev:bull:events:repeat"
2) "hmns:dev:bull:events:repeat:b5230d67db4ca2b571297e5f6cc5db8d:1584370800000"
3) "hmns:dev:bull:events:repeat:ba0b04b62c1854a6669fea27137765a9:1584369000000"
4) "hmns:dev:bull:events:delayed"
5) "hmns:dev:bull:events:stalled-check"
6) "hmns:dev:bull:events:id"
127.0.0.1:6379> zrange hmns:dev:bull:events:repeat 0 100
1) "clean::::30 * * * *"
2) "kick::::0 * * * *"

And now I run:

for (const repeatable of await queue.getRepeatableJobs()) {
  await queue.removeRepeatableByKey(repeatable.key)
}

And the state is updated to:

127.0.0.1:6379> keys *
1) "hmns:dev:bull:events:repeat:b5230d67db4ca2b571297e5f6cc5db8d:1584370800000"
2) "hmns:dev:bull:events:repeat:ba0b04b62c1854a6669fea27137765a9:1584369000000"
3) "hmns:dev:bull:events:delayed"
4) "hmns:dev:bull:events:stalled-check"
5) "hmns:dev:bull:events:id"

As you can see, the hmns:dev:bull:events:repeat has been removed, but the 2 repeat jobs aren't. I'm not sure this is the intended behaviour and what side effects this could cause.

Seems to be related to how the repeatJobId is being generated without millis here: https://github.com/OptimalBits/bull/blob/ec8ad57ecc6bd111097fb341be955fa68356e221/lib/repeatable.js#L103

Assignee
Assign to
Time tracking