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

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -