开发者

Quartz Cron Trigger with Spring - triggering new cron before last ended

开发者 https://www.devze.com 2022-12-25 11:43 出处:网络
Simple question, I think. I have org.springframework.scheduling.quartz.CronTriggerBean triggering one job once a day. Because this method can last a long ti开发者_JAVA技巧me (over 24 hours), will the

Simple question, I think.

I have org.springframework.scheduling.quartz.CronTriggerBean triggering one job once a day. Because this method can last a long ti开发者_JAVA技巧me (over 24 hours), will the next day at the same time a new job be executed if the last one is not ended yet?

If yes - is it possible to turn off executing new jobs until the last one is finished?

My method is trans-coding videos and some days there a lot of videos and could last long.


Make the Job stateful, So it will prevent the new instance before the previous instance of the job ended.

You 'mark' a Job as stateful by having it implement the StatefulJob interface. You will get more about stateful job here

0

精彩评论

暂无评论...
验证码 换一张
取 消