Ensure that Spring Quartz job execution doesn't overlap

后端 未结 7 1408
迷失自我
迷失自我 2020-11-28 23:12

I have a Java program that executes from Spring Qquartz every 20 seconds. Sometimes it takes just few seconds to execute, but as data gets bigger I\'m sure it run for 20 sec

7条回答
  •  情话喂你
    2020-11-28 23:22

    You can use a semaphore. When the semaphore is taken, abandon the 2nd job and wait until the next fire time.

提交回复
热议问题