made web server not start background tasks.

This commit is contained in:
Bryce Covert
2020-12-08 21:24:26 -08:00
parent 99b6d822f6
commit 689cae6192
7 changed files with 110 additions and 20 deletions

View File

@@ -1,12 +1,12 @@
(ns auto-ap.server
(:require #_[auto-ap.background.mail :refer [always-process-sqs]]
[auto-ap.handler :refer [app]]
[auto-ap.ledger]
[auto-ap.ledger :as ledger]
[auto-ap.yodlee.core]
[auto-ap.background.invoices]
[auto-ap.square.core]
[auto-ap.datomic.migrate]
[auto-ap.yodlee.import]
[auto-ap.square.core :as square]
[auto-ap.datomic.migrate :as migrate]
[auto-ap.yodlee.import :as yodlee]
[nrepl.server :refer [start-server stop-server]]
[config.core :refer [env]]
[ring.adapter.jetty :refer [run-jetty]]
@@ -28,6 +28,16 @@
(mount/stop))
(defn -main [& args]
(add-shutdown-hook! shutdown-mount)
(start-server :port 9000 :bind "0.0.0.0" #_#_:handler (cider-nrepl-handler))
(mount/start))
(let [without (cond-> #{}
(not (env :run-web? )) (into [#'jetty])
(not (env :run-background?)) (into [#'square/square-loader
#'square/square-settlement-loader
#'ledger/touch-broken-ledger-worker
#'ledger/process-txes-worker
#'ledger/ledger-reconciliation-worker
#'yodlee/import-transaction-worker
#'migrate/migrate-start]))]
(add-shutdown-hook! shutdown-mount)
(start-server :port 9000 :bind "0.0.0.0" #_#_:handler (cider-nrepl-handler))
(mount/start-without without)))