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

RemoveRepeatable doesn't work anymore! #2467

Closed
rileyai-dev opened this issue Nov 15, 2022 · 4 comments
Closed

RemoveRepeatable doesn't work anymore! #2467

rileyai-dev opened this issue Nov 15, 2022 · 4 comments

Comments

@rileyai-dev
Copy link

rileyai-dev commented Nov 15, 2022

Description

Removing repeatable jobs doesn't work anymore. I use the same code I had for v1.x but now it fails. I am simply adding a repeatable job and remove it.

Minimal, Working Test code to reproduce the issue.

This very basic example returns false. All you need to do is replace connection with your connection settings.

(async () => {
  const myQueue = new Queue('cron', connection).on('error', (err) => {
    logger.error(`myQueue - ${JSON.stringify(err)}`);
  });
  await myQueue.add(
    'id',
    {
      data: 'myData',
    },
    {
      attempts: 1,
      repeat: { cron: '07 12 * * 1-5', tz: 'America/New_York' },
    }
  );
  const removed = await myQueue.removeRepeatable('id', {
    cron: '07 12 * * 1-5',
    tz: 'America/New_York',
  });
  console.log(removed);
})();

Bull version

3.2.1

Additional information

@manast
Copy link
Member

manast commented Nov 15, 2022

We have some tests that remove jobs and they are passing, not sure what would be the difference between those tests and your code: https://github.com/OptimalBits/bull/blob/develop/test/test_repeat.js#L423

@rileyai-dev
Copy link
Author

Oh, just found out that cron was changed to pattern. The doc is not very explicit about tz.

@manast
Copy link
Member

manast commented Nov 15, 2022

@rileyai-dev no, it has not changed to pattern, that is in BullMQ only. I happen to post wrong link in my first comment, but it is corrected now.

@rileyai-dev
Copy link
Author

Got confused between bull and BullMQ, my bad!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants