Heartbeats scheduled things so that I can do health on them
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
(ns auto-ap.utils)
|
||||
(ns auto-ap.utils
|
||||
#?@
|
||||
(:clj
|
||||
[(:require [clojure.tools.logging :as log])]))
|
||||
|
||||
(defn by
|
||||
([f xs]
|
||||
@@ -79,3 +82,14 @@
|
||||
(f)
|
||||
(finally
|
||||
(reset! in-progress? false)))))))
|
||||
|
||||
|
||||
(defn heartbeat [f id]
|
||||
(fn []
|
||||
#?(:clj
|
||||
(do
|
||||
(log/info "Heartbeat for " id)
|
||||
(f))
|
||||
|
||||
:cljs (do (println "Heartbeat for " id)
|
||||
(f)))))
|
||||
|
||||
Reference in New Issue
Block a user