Skip to content

Commit

Permalink
fix(cron): fix to not fire the same cron job on multiple instances (#592
Browse files Browse the repository at this point in the history
)

it seems that `read-committed` on mysql doesn't have strong enough locking for
quartz to ensure only one clustered instance picks up a given cron trigger.
[Documentation](http://www.quartz-scheduler.org/documentation/quartz-2.1.7/configuration/ConfigJobStoreTX.html) suggests to set `acquireTriggersWithinLock` to `true`
  • Loading branch information
marchello2000 committed Jul 2, 2019
1 parent ea06760 commit 1708ec0
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ class SchedulerConfiguration {
if (sqlEnabled) {
Properties props = new Properties()
props.put("org.quartz.jobStore.isClustered", "true")
props.put("org.quartz.jobStore.acquireTriggersWithinLock", "true")
schedulerFactoryBean.setQuartzProperties(props)
}
schedulerFactoryBean.setGlobalTriggerListeners(triggerListener)
Expand Down

0 comments on commit 1708ec0

Please sign in to comment.