much more background process tracking

This commit is contained in:
2022-06-22 10:43:37 -07:00
parent 480066b202
commit 1db8d7a52c
15 changed files with 379 additions and 486 deletions

View File

@@ -8,16 +8,16 @@
[auto-ap.graphql.utils
:refer [->graphql <-graphql assert-admin assert-can-see-client result->page]]
[auto-ap.parse.util :as parse]
[auto-ap.utils :refer [by dollars=]]
[auto-ap.pdf.ledger :refer [print-pnl print-balance-sheet]]
[auto-ap.pdf.ledger :refer [print-balance-sheet print-pnl]]
[auto-ap.utils :refer [by dollars= heartbeat]]
[clj-time.coerce :as coerce]
[clj-time.core :as t]
[clojure.tools.logging :as log]
[com.walmartlabs.lacinia.util :refer [attach-resolvers]]
[datomic.api :as d]
[mount.core :as mount]
[unilog.context :as lc]
[yang.scheduler :as scheduler]
[clj-time.core :as t]))
[yang.scheduler :as scheduler]))
(mount/defstate running-balance-cache
:start (atom {}))
@@ -525,16 +525,11 @@
(defn refresh-running-balance-cache []
(lc/with-context {:source "running-balance-cache"}
(try
(log/info "Refreshing running balance cache")
(build-running-balance-cache)
(catch Exception e
(log/error e)))))
(build-running-balance-cache))
(mount/defstate running-balance-cache-worker
:start (scheduler/every (* 15 60 1000) refresh-running-balance-cache)
:start (scheduler/every (* 15 60 1000) (heartbeat refresh-running-balance-cache "running-balance-cache"))
:stop (scheduler/stop running-balance-cache-worker))