Skip to content
Snippets Groups Projects
Unverified Commit 473910ee authored by Cam Saul's avatar Cam Saul
Browse files

Update Pulse + Sync misfire instructions

parent 6ede0358
No related merge requests found
......@@ -115,9 +115,11 @@
(cron/schedule
;; run at the top of every hour
(cron/cron-schedule "0 0 * * * ? *")
;; If a trigger misfires (i.e., Quartz cannot run our job for one reason or another, such as all
;; worker threads being busy), attempt to fire the triggers again ASAP. This article does a good
;; job explaining what this means:
;; https://www.nurkiewicz.com/2012/04/quartz-scheduler-misfire-instructions.html
(cron/with-misfire-handling-instruction-ignore-misfires))))]
;; If send-pulses! misfires, don't try to re-send all the misfired Pulses. Retry only the most
;; recent misfire, discarding all others. This should hopefully cover cases where a misfire
;; happens while the system is still running; if the system goes down for an extended period of
;; time we don't want to re-send tons of (possibly duplicate) Pulses.
;;
;; See https://www.nurkiewicz.com/2012/04/quartz-scheduler-misfire-instructions.html
(cron/with-misfire-handling-instruction-fire-and-proceed))))]
(task/schedule-task! job trigger)))
......@@ -150,11 +150,11 @@
(triggers/with-schedule
(cron/schedule
(cron/cron-schedule (cron-schedule database task-info))
;; If we miss a trigger, try again at the next opportunity, but only try it once. If we miss two triggers in a
;; row (i.e. more than an hour goes by) then the job should still execute, but drop the additional occurrences
;; of the same trigger (i.e. no need to run the job 3 times because it was missed three times, once is all we
;; need)
(cron/with-misfire-handling-instruction-fire-and-proceed)))))
;; if we miss a sync for one reason or another (such as system being down) do not try to run the sync again.
;; Just wait until the next sync cycle.
;;
;; See https://www.nurkiewicz.com/2012/04/quartz-scheduler-misfire-instructions.html for more info
(cron/with-misfire-handling-instruction-do-nothing)))))
(s/defn ^:private schedule-tasks-for-db!
"Schedule a new Quartz job for `database` and `task-info`."
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment