Skip to content
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

[Bug]: Duplicate Jobs Created Despite Same Custom Key with Different Repeat Intervals #2399

Closed
1 task done
erenkurnaz opened this issue Jan 26, 2024 · 0 comments · Fixed by #2617
Closed
1 task done
Labels
bug Something isn't working

Comments

@erenkurnaz
Copy link
Contributor

Version

v5.1.5

Platform

NodeJS

What happened?

Description:
I've encountered an issue related to creating repeated jobs with a custom key using the BullMQ package. This functionality was introduced in PR #1824.

Issue:
When I add a job with the same repeat interval and custom key, no duplicate jobs are created, which is the expected behavior:

await queue.add(queueName, {}, {
  repeat: {
    every: 1 * 1000,
    key: 'custom-key'
  },
});

However, changing the repeat interval while keeping the same key results in the creation of duplicate jobs:

await queue.add(queueName, {}, {
  repeat: {
    every: 2 * 1000,
    key: 'custom-key'
  },
});

Expected Behavior:
Even when the repeat interval is modified, as long as the custom key remains the same, it should not result in duplicate jobs. The uniqueness of a job should be maintained based on the custom key provided.

How to reproduce.

Steps to Reproduce:

  • Create a repeated job with a specific interval and a custom key.
  • Create another job with a different interval but the same custom key.
  • Observe that duplicate jobs are created.

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@erenkurnaz erenkurnaz added the bug Something isn't working label Jan 26, 2024
github-actions bot pushed a commit that referenced this issue Jul 16, 2024
# [5.10.0](v5.9.0...v5.10.0) (2024-07-16)

### Features

* **repeatable:** new repeatables structure ([#2617](#2617)) ref [#2612](#2612) fixes [#2399](#2399) [#2596](#2596) ([8376a9a](8376a9a))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant