🎉 Add simple telemetry server module.

This commit is contained in:
Andrey Antukh 2020-12-27 22:47:31 +01:00 committed by Alonso Torres
parent 4d9418e620
commit 707fa160e8
12 changed files with 433 additions and 309 deletions

View file

@ -293,11 +293,12 @@
(s/def ::cron dt/cron?)
(s/def ::props (s/nilable map?))
(s/def ::scheduled-task
(s/def ::scheduled-task-spec
(s/keys :req-un [::id ::cron ::fn]
:opt-un [::props]))
(s/def ::schedule (s/coll-of ::scheduled-task))
(s/def ::schedule
(s/coll-of (s/nilable ::scheduled-task-spec)))
(defmethod ig/pre-init-spec ::scheduler [_]
(s/keys :req-un [::executor ::db/pool ::schedule]))
@ -307,7 +308,8 @@
(let [scheduler (Executors/newScheduledThreadPool (int 1))
cfg (assoc cfg :scheduler scheduler)]
(synchronize-schedule cfg)
(run! (partial schedule-task cfg) schedule)
(run! (partial schedule-task cfg)
(filter some? schedule))
(reify
java.lang.AutoCloseable
(close [_]