@Scheduled(fixedDelay = 5000)
public void myJob() {
Thread.sleep(12000);
}
How can I prevent this spring job from running if the previous routine is not yet finished?
With fixedDelay
, the period is measured after the completion of job, so no worries.