attempting for square 3 approach.

This commit is contained in:
Bryce Covert
2023-01-06 16:34:30 -08:00
parent 7cd1b689f7
commit ad5841135a
6 changed files with 793 additions and 10 deletions

View File

@@ -4,15 +4,17 @@
[auto-ap.datomic :refer [conn]]
[clojure.tools.logging :as log]
[auto-ap.background.metrics :refer [metrics-setup container-tags container-data logging-context]]
[unilog.context :as lc]))
[unilog.context :as lc]
[com.brunobonacci.mulog :as mu]))
(defn execute [name f]
(try
(lc/with-context {:background-job name}
(mount/start (mount/only #{#'conn #'metrics-setup #'container-tags #'logging-context #'container-data}))
((heartbeat f name))
(log/info "Stopping " name)
(Thread/sleep 15000)
(mount/stop))
(mu/with-context {:background-job name}
(mount/start (mount/only #{#'conn #'metrics-setup #'container-tags #'logging-context #'container-data}))
((heartbeat f name))
(log/info "Stopping " name)
(Thread/sleep 15000)
(mount/stop)))
(finally
(System/exit 0))))