question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add a CronExpression.NEVER expression

See original GitHub issue

Is there an existing issue that is already proposing this?

  • 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.

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:3
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
origranotcommented, Dec 16, 2022

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

I would like, I will looking on it.

0reactions
xeguloncommented, Dec 16, 2022

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Quartz: Cron expression that will never execute - Stack Overflow
If you're using spring 5.1+ (springBoot 2.1+) simply use "${your.cron.prop:-} and don't set the property to disable execution - see @Scheduled.
Read more >
Ability to schedule cron that never occurs · Issue #724 - GitHub
Scheduling to cron expression like * * 31 Feb * isn't currently possible. If such cron expression is provided then CrontabSchedule.
Read more >
A Guide To Cron Expressions - Baeldung
Simply put, cron is a basic utility available on Unix-based systems. It enables users to schedule tasks to run periodically at a specified ......
Read more >
New in Spring 5.3: Improved Cron Expressions
While Spring generally prefers to maintain backward compatible, sometimes we do believe that starting from scratch is the best option. Usage.
Read more >
Cron Trigger Tutorial
CronTrigger uses “cron expressions”, which are able to create firing ... This tutorial aims to take some of the mystery out of creating...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found