i have spring boot project with a cron job. the job should be run only once. it should trigger again only if app is crashed or app is restarted. is there any cron expression for this ? or any way to achieve this ?
i have spring boot project with a cron job. the job should be run only once. it should trigger again only if app is crashed or app is restarted. is there any cron expression for this ? or any way to achieve this ?
If run once when app start, that is not a cron IMHO... Actually you only need to run it when you application finishes booting. Thus, listen to the application booted event, and run your code then. For example, this one: Running code after Spring Boot starts