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

Mismatch with bull #2028

Open
2 of 4 tasks
IbrohimIsroilov opened this issue Mar 8, 2024 · 2 comments
Open
2 of 4 tasks

Mismatch with bull #2028

IbrohimIsroilov opened this issue Mar 8, 2024 · 2 comments
Labels
bug Something isn't working needs triage

Comments

@IbrohimIsroilov
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

if (opts.cron && opts.every) {
throw new Error(
'Both .cron and .every options are defined for this repeatable job'
);
}

Minimum reproduction code

https://www.npmjs.com/package/bull

Steps to reproduce

No response

Expected behavior

if (opts.pattern && opts.every) {
throw new Error(
'Both .cron and .every options are defined for this repeatable job'
);
}

Package version

10.0.1

Bull version

No response

NestJS version

10

Node.js version

20.10.0

In which operating systems have you tested?

  • macOS
  • Windows
  • Linux

Other

bull is expecting cron field in the options. But in nestjs/bull, pattern is being used instead of cron

@IbrohimIsroilov IbrohimIsroilov added bug Something isn't working needs triage labels Mar 8, 2024
@IbrohimIsroilov IbrohimIsroilov changed the title Version Mismatch with bull Mismatch with bull Mar 8, 2024
@kamilmysliwiec
Copy link
Member

Please provide a minimum reproduction repository (Git repository/StackBlitz/CodeSandbox project).

@IbrohimIsroilov
Copy link
Author

https://codesandbox.io/p/devbox/rncx6k?file=%2Fmy-nest-bull%2Fsrc%2Fapp.service.ts%3A13%2C69

This is a minimum reproduction repository.

const createdJobData = await this.pushQueue.add(jobName, data, {
repeat: { pattern: '* * * * *' },
});

Can you pay attention to this part of the code. In the repeat option, it is forcing to use 'pattern' keyword. But actually it should be 'cron' keyword.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage
Projects
None yet
Development

No branches or pull requests

2 participants