Skip to content
Advertisement

Updating CroneSchedule & Job Dynamically without stopping server

I need help in externalizing the below cron schedule or executing it dynamically. For example, in the below code it is hardcoded to perform every Saturday: cronSchedule(“0 0 12 ? * SAT”). I want the value inside the cronSchedule() to externalize so that even after the server is started, I can still change the cron schedule to Monday or every day based on my choice and it can be run. I am looking for suggestion in java and not in spring.

JavaScript

Any input or suggestion is appreciated.

Advertisement

Answer

We can perform below method to reschedule the job :

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement