splitting out background tasks

This commit is contained in:
2022-09-18 06:51:17 -07:00
parent 8b271e9e2a
commit 5017d9bc67
6 changed files with 287 additions and 244 deletions

View File

@@ -16,7 +16,6 @@
[datomic.api :as d]
[mount.core :as mount]
[unilog.context :as lc]
[yang.scheduler :as scheduler]
[clojure.set :as set])
(:import
(java.util UUID)
@@ -264,10 +263,6 @@
(defn refresh-current-balance []
(build-current-balance (bank-accounts-needing-refresh)))
(mount/defstate current-balance-worker
:start (scheduler/every (* 17 60 1000) (heartbeat refresh-current-balance "current-balance-cache"))
:stop (scheduler/stop current-balance-worker))
(defn get-client [context _ _]
(->graphql
(->> (d-clients/get-all)