Pulling out other imports
This commit is contained in:
20
src/clj/auto_ap/jobs/plaid.clj
Normal file
20
src/clj/auto_ap/jobs/plaid.clj
Normal file
@@ -0,0 +1,20 @@
|
||||
(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]))
|
||||
|
||||
(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))))
|
||||
Reference in New Issue
Block a user