cron - Spring scheduler which is run after application is started and after midnight -


how describe spring scheduler run after application started , after 00:00 ?

i 2 separate constructs.

for after application starts, use @postconstuct, , every night @ midnight use @scheduled cron value set. both applied method.

public class myclass {     @postconstruct     public void onstartup() {         dowork();     }      @scheduled(cron="0 0 0 * * ?")     public void onschedule() {         dowork();     }      public void dowork() {         // work required on startup , @ midnight     } } 

Comments

Popular posts from this blog

Winapi c++: DialogBox hangs when breaking a loop -

vb.net - Font adding using PDFsharp -

javascript - jQuery iScroll clickable list elements while retaining scroll? -