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

@@ -222,12 +222,6 @@
(log/warn "repairing " (count txes-missing-ledger-entries) " missing transactions, " (count invoices-missing-ledger-entries) " missing invoices that were missing ledger entries")
@(d/transact conn repairs)))))
(mount/defstate reconciliation-frequency :start (* 1000 60 60))
(mount/defstate ledger-reconciliation-worker
:start (scheduler/every reconciliation-frequency (heartbeat reconcile-ledger "reconcile-ledger"))
:stop (scheduler/stop ledger-reconciliation-worker))
(defn touch-transaction [e]
@(d/transact conn [[:db/retractEntity [:journal-entry/original-entity e]]])
@@ -465,7 +459,3 @@
:text "This process looks for unbalance ledger entries, or missing ledger entries"
:priority :low}
nil))
(mount/defstate touch-broken-ledger-worker
:start (scheduler/every reconciliation-frequency (heartbeat touch-broken-ledger "touch-broken-ledger"))
:stop (scheduler/stop touch-broken-ledger-worker))