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))))) (log/error e)))))
(mount/defstate touch-broken-ledger-worker (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)) :stop (scheduler/stop touch-broken-ledger-worker))

View File

@@ -502,7 +502,7 @@
(upsert-refunds client)))) (upsert-refunds client))))
(mount/defstate square-loader (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)) :stop (scheduler/stop square-loader))

View File

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