A bunch of bug fixes.

This commit is contained in:
Bryce Covert
2020-07-29 21:12:31 -07:00
parent 9453f78e0e
commit 6df080cc3f
8 changed files with 224 additions and 16 deletions

View File

@@ -164,3 +164,26 @@
#_(process-all)
#_(reset! break true)
(defn keep-up-to-date []
(while (and (not @break)
(not (Thread/interrupted)))
(try
@(d/transact
(d/connect uri)
(mapv
#(auto-ap.ledger/entity-change->ledger (d/db (d/connect uri)) [:transaction %])
(concat
(->>
(d/query {:query {:find ['?t ]
:in ['$]
:where ['[?t :transaction/date]
'(not [?t :transaction/approval-status :transaction-approval-status/excluded])
'(not-join [?t] [?e :journal-entry/original-entity ?t])]}
:args [(d/db (d/connect uri))]})
(map first)))))
(Thread/sleep 60000)
(catch Exception e
(println (.toString e))))))