statsd better approach

This commit is contained in:
2022-09-17 06:59:41 -07:00
parent 98f21bf3df
commit 4bcb2b7c53
4 changed files with 11 additions and 11 deletions

View File

@@ -5,13 +5,14 @@
[mount.core :as mount]
[auto-ap.datomic :refer [conn]]
[clojure.tools.logging :as log]
[auto-ap.background.metrics :refer [metrics-setup]]
[unilog.context :as lc]))
(defn -main [& _]
(lc/with-context {:background-job "square-loading-new"}
(mount/start (mount/only #{#'conn}))
(mount/start (mount/only #{#'conn #'metrics-setup}))
((heartbeat square/upsert-all "square-loading"))
(mount/stop (mount/only #{#'conn}))
(mount/stop (mount/only #{#'conn #'metrics-setup}))
(log/info "Stopping Square loading")
(System/exit 0)))