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

Feature request: add runOnInit options in Cron decorator #274

Closed
nesso99 opened this issue Aug 8, 2020 · 1 comment
Closed

Feature request: add runOnInit options in Cron decorator #274

nesso99 opened this issue Aug 8, 2020 · 1 comment

Comments

@nesso99
Copy link

nesso99 commented Aug 8, 2020

I'm submitting a...


[ ] Regression 
[ ] Bug report
[x] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.

Current behavior

Cannot set runOnInit by Cron decorator
https://github.com/nestjs/schedule/blob/master/lib/decorators/cron.decorator.ts#L22

Expected behavior

Can set runOnInit by Cron decorator.
I think you can use runOnInit options instead of starting cron on application bootstrap
https://github.com/nestjs/schedule/blob/master/lib/scheduler.orchestrator.ts#L81

Minimal reproduction of the problem with instructions

What is the motivation / use case for changing the behavior?

You can decide to run a cron at startup or not. I know you can use "Dynamic Cron jobs" but I think using decorators is a better way.

Environment


Nest version: 7.4.2

 
For Tooling issues:
- Node version: 12  
- Platform:  Windows 

Others:

@kamilmysliwiec
Copy link
Member

This has been discussed already. Please, search for old issues.

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