Captures causes of slowness

This commit is contained in:
2024-09-24 22:38:33 -07:00
parent a9df724793
commit bcd78e7813
2 changed files with 22 additions and 19 deletions

View File

@@ -1 +0,0 @@
,noti,pop-os,24.08.2024 23:11,file:///home/noti/.config/libreoffice/4;

View File

@@ -1,20 +1,21 @@
(ns auto-ap.import.transactions
(:require
[auto-ap.datomic :refer [audit-transact conn random-tempid remove-nils]]
[auto-ap.datomic.accounts :as a]
[auto-ap.datomic.checks :as d-checks]
[auto-ap.datomic.transaction-rules :as tr]
[auto-ap.datomic.transactions :as d-transactions]
[auto-ap.rule-matching :as rm]
[auto-ap.solr :as solr]
[auto-ap.time :as atime]
[auto-ap.utils :refer [dollars=]]
[clj-time.coerce :as coerce]
[clj-time.core :as t]
[clojure.core.cache :as cache]
[auto-ap.logging :as alog]
[datomic.api :as dc]
[digest :as di]))
(:require [auto-ap.datomic :refer [audit-transact conn random-tempid
remove-nils]]
[auto-ap.datomic.accounts :as a]
[auto-ap.datomic.checks :as d-checks]
[auto-ap.datomic.transaction-rules :as tr]
[auto-ap.datomic.transactions :as d-transactions]
[auto-ap.logging :as alog]
[auto-ap.rule-matching :as rm]
[auto-ap.solr :as solr]
[auto-ap.time :as atime]
[auto-ap.utils :refer [dollars=]]
[clj-time.coerce :as coerce]
[clj-time.core :as t]
[clojure.core.cache :as cache]
[com.brunobonacci.mulog :as mu]
[datomic.api :as dc]
[digest :as di]))
(defn rough-match [client-id bank-account-id amount]
(if (and client-id bank-account-id amount)
@@ -269,8 +270,11 @@
))))
(defn maybe-code [{:transaction/keys [client amount] :as transaction} apply-rules valid-locations]
(when-not (seq (match-transaction-to-unpaid-invoices amount client))
(apply-rules transaction valid-locations)))
(mu/trace
::maybe-code
[]
(when-not (seq (match-transaction-to-unpaid-invoices amount client))
(apply-rules transaction valid-locations))))
(defn maybe-apply-default-vendor [t]
(cond-> t