fix for touching broken ledger being noisy.
This commit is contained in:
@@ -3,6 +3,8 @@
|
|||||||
[auto-ap.datomic :refer [conn remove-nils]]
|
[auto-ap.datomic :refer [conn remove-nils]]
|
||||||
[auto-ap.logging :refer [info-event]]
|
[auto-ap.logging :refer [info-event]]
|
||||||
[auto-ap.utils :refer [dollars-0? dollars=]]
|
[auto-ap.utils :refer [dollars-0? dollars=]]
|
||||||
|
[clj-time.core :as t]
|
||||||
|
[clj-time.coerce :as c]
|
||||||
[clojure.tools.logging :as log]
|
[clojure.tools.logging :as log]
|
||||||
[com.unbounce.dogstatsd.core :as statsd]
|
[com.unbounce.dogstatsd.core :as statsd]
|
||||||
[datomic.api :as d]
|
[datomic.api :as d]
|
||||||
@@ -293,7 +295,17 @@
|
|||||||
]
|
]
|
||||||
(filter
|
(filter
|
||||||
(fn [[e accounts]] (not= accounts (get jel-accounts e)))
|
(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 []
|
(defn unbalanced-transactions []
|
||||||
(->> (d/query {:query {:find ['?je '?a '(sum ?debit) '(sum ?credit)]
|
(->> (d/query {:query {:find ['?je '?a '(sum ?debit) '(sum ?credit)]
|
||||||
|
|||||||
Reference in New Issue
Block a user