More background task cleanup
This commit is contained in:
@@ -1,20 +1,8 @@
|
||||
(ns auto-ap.jobs.plaid
|
||||
(:gen-class)
|
||||
(:require [auto-ap.utils :refer [heartbeat]]
|
||||
[mount.core :as mount]
|
||||
[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]
|
||||
[auto-ap.import.plaid :as plaid]))
|
||||
(:require
|
||||
[auto-ap.import.plaid :as plaid]
|
||||
[auto-ap.jobs.core :refer [execute]]))
|
||||
|
||||
(defn -main [& _]
|
||||
(try
|
||||
(lc/with-context {:background-job "import-plaid"}
|
||||
(mount/start (mount/only #{#'conn #'metrics-setup #'container-tags #'logging-context #'container-data}))
|
||||
((heartbeat plaid/import-plaid "import-plaid"))
|
||||
(mount/stop)
|
||||
(log/info "Stopping plaid import")
|
||||
(Thread/sleep 15000))
|
||||
(finally
|
||||
(System/exit 0))))
|
||||
(execute "import-plaid" plaid/import-plaid))
|
||||
|
||||
Reference in New Issue
Block a user