My application is based on spring boot. I want to create a task which should be run only once after application has been started.
Currently, I am looking into two solutions:
Using
@Scheduled
and boolean property which should determine whether the logic shold be run or not.@Scheduled public void method(){ if(method_run_propery){ //do something; } }
Using Quartz. But I have not used before.
Please, tell me what is the best approach to use in this case.