Reputation: 384
What I tried:
@Scheduled(cron="* * * 08 04 2099")
I want cron expression that never executes.can any one help me with the expression.
Thanks in advance...!
Upvotes: 0
Views: 3744
Reputation: 9507
You can use.
@Scheduled(cron = "${cron.expression}")
cron.expression=-
This works from Spring 5.1.
See the docs.
Upvotes: 2
Reputation: 2352
This cron will run every minute and task will be bound with condition. If you need different cron job then you can generate using this website.
@Scheduled(cron = "0 0/1 * 1/1 * ? *")
protected void performTask() {
if (condition)//if value matches with database value
{
//perform the task
}
}
Upvotes: 1