fix for touching broken ledger being noisy.

This commit is contained in:
2022-04-03 08:05:57 -07:00
parent 7739c18bc2
commit 52bd8b5671

View File

@@ -3,6 +3,8 @@
[auto-ap.datomic :refer [conn remove-nils]]
[auto-ap.logging :refer [info-event]]
[auto-ap.utils :refer [dollars-0? dollars=]]
[clj-time.core :as t]
[clj-time.coerce :as c]
[clojure.tools.logging :as log]
[com.unbounce.dogstatsd.core :as statsd]
[datomic.api :as d]
@@ -293,7 +295,17 @@
]
(filter
(fn [[e accounts]] (not= accounts (get jel-accounts e)))
transaction-accounts)))
transaction-accounts)
(filter (fn [[e]]
(let [[tx-date] (d/q '[:find [(max ?d) ...]
:in $ ?t
:where
[?t _ _ ?tx]
[?tx :db/txInstant ?d]]
(d/history (d/db auto-ap.datomic/conn))
e)]
(t/before? (c/to-date-time tx-date)
(t/minus (t/now) (t/hours 1))))))))
(defn unbalanced-transactions []
(->> (d/query {:query {:find ['?je '?a '(sum ?debit) '(sum ?credit)]