How to prevent concurrent execution of a job in Grails?

后端 未结 4 1216
长情又很酷
长情又很酷 2021-02-19 05:12

I have a quartz job in grails, that needs to be executed in every 5s, but I need this sequentially. In some situations the execution of the job exceeds this 5s, in this case I d

4条回答
  •  礼貌的吻别
    2021-02-19 05:48

    For Quartz-based jobs concurrency is achieved using

    static concurrent = false
    

    in the job class.

    Note the static in the definition, this is needed instead of def concurrent = false at least since version 2.0.12. See the Quartz documentation.

提交回复
热议问题