Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support disabling cron jobs registered via SchedulingConfigurer
Prior to this commit, support was provided for disabling cron jobs configured with an explicit "-" cron expression. However, the "-" expression was only supported when supplied via the @scheduled annotation. This commit adds support for disabling cron jobs configured with the "-" cron expression when a cron job is registered via the addCronTask(Runnable, String) method in the ScheduledTaskRegistrar supplied to a SchedulingConfigurer. Closes gh-23568
- Loading branch information
Showing
2 changed files
with
65 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d689ef8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sbrannen , why not reuse
org.springframework.scheduling.annotation.Scheduled.CRON_DISABLED
?d689ef8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To avoid a package cycle
d689ef8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@quaff, see also a676059