Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Metabase
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Engineering Digital Service
Metabase
Commits
473910ee
Unverified
Commit
473910ee
authored
5 years ago
by
Cam Saul
Browse files
Options
Downloads
Patches
Plain Diff
Update Pulse + Sync misfire instructions
parent
6ede0358
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/metabase/task/send_pulses.clj
+7
-5
7 additions, 5 deletions
src/metabase/task/send_pulses.clj
src/metabase/task/sync_databases.clj
+5
-5
5 additions, 5 deletions
src/metabase/task/sync_databases.clj
with
12 additions
and
10 deletions
src/metabase/task/send_pulses.clj
+
7
−
5
View file @
473910ee
...
...
@@ -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
)))
This diff is collapsed.
Click to expand it.
src/metabase/task/sync_databases.clj
+
5
−
5
View file @
473910ee
...
...
@@ -150,11 +150,11 @@
(
triggers/with-schedule
(
cron/schedule
(
cron/cron-schedule
(
cron-schedule
database
task-info
))
;;
I
f 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 s
til
l
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
)))))
;;
i
f we miss a
sync for one reason or another (such as system being down) do not try to run the sync again.
;;
Just wait un
til
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`."
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment