performance optimization, much faster when only looking up check if transaction not found.

This commit is contained in:
Bryce Covert
2020-12-08 20:43:27 -08:00
parent 65ac96b8a4
commit 99b6d822f6
2 changed files with 34 additions and 33 deletions

View File

@@ -92,7 +92,7 @@
client (:client/_bank-accounts bank-account)
client-id (:db/id client)
valid-locations (or (:bank-account/locations bank-account) (:client/locations client))
check (transaction->payment transaction check-number client-id bank-account-id amount id)
date (time/parse date "YYYY-MM-dd")]
:when (and client-id
(not (existing (sha-256 (str id))))
@@ -101,6 +101,7 @@
(or (not (:start-date bank-account))
(t/after? date (:start-date bank-account)))
)]
(let [check (transaction->payment transaction check-number client-id bank-account-id amount id)]
(->
#:transaction
{:post-date (coerce/to-date (time/parse post-date "YYYY-MM-dd"))
@@ -132,7 +133,7 @@
:amount (Math/abs (double amount))}])}
(apply-rules valid-locations)
remove-nils))))
remove-nils)))))
(defn batch-transact [transactions]

View File

@@ -83,8 +83,8 @@ resource "aws_lb_target_group" "integreat_app" {
path = "/api/health-check"
port = "traffic-port"
protocol = "HTTP"
timeout = 5
unhealthy_threshold = 2
timeout = 14
unhealthy_threshold = 5
}
stickiness {