add mastodon cron
This commit is contained in:
parent
6249124c17
commit
ded5314125
2 changed files with 13 additions and 7 deletions
|
|
@ -3,12 +3,17 @@
|
|||
(:import [java.time Instant Duration])
|
||||
(:require [chime.core :as chime]
|
||||
[taoensso.telemere :as tel]
|
||||
[micro-blog.blue-sky :as blue-sky]))
|
||||
[micro-blog.blue-sky :as blue-sky]
|
||||
[micro-blog.mastodon :as masto]))
|
||||
|
||||
(def crons [blue-sky/run
|
||||
masto/run])
|
||||
|
||||
(defn -main []
|
||||
(tel/log! :info "Setting up crons")
|
||||
(chime/chime-at (chime/periodic-seq (Instant/now) (Duration/ofMinutes 30))
|
||||
(fn [_time]
|
||||
(blue-sky/run)))
|
||||
|
||||
(doseq [[i cron] (map-indexed vector crons)]
|
||||
(let [start (.plus (Instant/now) (Duration/ofMinutes (* i 5)))]
|
||||
(chime/chime-at (chime/periodic-seq start (Duration/ofMinutes 30))
|
||||
(fn [_time]
|
||||
(cron)))))
|
||||
@(promise))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue