schedule icon indicating copy to clipboard operation
schedule copied to clipboard

Add a CronExpression.NEVER expression

Open xegulon opened this issue 2 years ago • 3 comments

Is there an existing issue that is already proposing this?

  • [X] I have searched the existing issues

Is your feature request related to a problem? Please describe it

I want to programmatically choose the expression that I'll put in a @Cron() and sometimes (in some environments) I don't want the Cron job to execute.

Describe the solution you'd like

I'd like to have a new enum, name CronExpression.NEVER, that I can put into the @Cron

Teachability, documentation, adoption, migration strategy

No response

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

The motivation is that it is a clean solution. An alernative would be to use the scheduler registry in main.ts to stop the cron job, but it is less flexible.

xegulon avatar Sep 29 '22 11:09 xegulon

Would you like to create a PR for this issue?

kamilmysliwiec avatar Sep 30 '22 07:09 kamilmysliwiec

Would you like to create a PR for this issue?

Yeah I'll try! Alternatively, what about a disabled field in CronOptions?

In this file: lib/decorators/cron.decorator.ts

xegulon avatar Sep 30 '22 13:09 xegulon

Sounds good

kamilmysliwiec avatar Oct 03 '22 07:10 kamilmysliwiec

@xegulon Are you still working on this issue?

origranot avatar Dec 16 '22 00:12 origranot

@origranot no sorry, would you like to do the PR?

xegulon avatar Dec 16 '22 08:12 xegulon

@origranot no sorry, would you like to do the PR?

I would, I will take a look 💯

origranot avatar Dec 16 '22 10:12 origranot