service check implementation

This commit is contained in:
2022-06-21 16:46:13 -07:00
parent 183ebf9da5
commit 3d92fe11b8
3 changed files with 8 additions and 8 deletions

View File

@@ -423,5 +423,5 @@
(log/error e)))))
(mount/defstate touch-broken-ledger-worker
:start (scheduler/every reconciliation-frequency (heartbeat touch-broken-ledger :touch-broken-ledger))
:start (scheduler/every reconciliation-frequency (heartbeat touch-broken-ledger "touch-broken-ledger"))
:stop (scheduler/stop touch-broken-ledger-worker))

View File

@@ -502,7 +502,7 @@
(upsert-refunds client))))
(mount/defstate square-loader
:start (scheduler/every (* 4 59 60 1000) (heartbeat upsert-all :square-loading))
:start (scheduler/every (* 4 59 60 1000) (heartbeat upsert-all "square-loading"))
:stop (scheduler/stop square-loader))

View File

@@ -1,7 +1,7 @@
(ns auto-ap.utils
#?@
(:clj
[(:require [clojure.tools.logging :as log])]))
[(:require [com.unbounce.dogstatsd.core :as statsd])]))
(defn by
([f xs]
@@ -86,10 +86,10 @@
(defn heartbeat [f id]
(fn []
#?(:clj
(do
(log/info "Heartbeat for " id)
(f))
#?(:clj (do
(f)
(statsd/service-check {:name (str id)
:status :ok}
nil))
:cljs (do (println "Heartbeat for " id)
(f)))))