fixes load from historical sales.

This commit is contained in:
Bryce
2023-05-23 16:36:07 -07:00
parent 8cb8a92a2f
commit 9366347245
3 changed files with 8 additions and 8 deletions

View File

@@ -11,7 +11,7 @@
(defn wrap-integration [f bank-account]
(try
(let [result (f)]
@(dc/transact conn [{:db/id bank-account
@(dc/transact-async conn [{:db/id bank-account
:bank-account/integration-status
{:db/id (bank-account->integration-id bank-account)
:integration-status/state :integration-state/success
@@ -19,7 +19,7 @@
:integration-status/last-updated (java.util.Date.)}}])
result)
(catch Exception e
@(dc/transact conn [{:db/id bank-account
@(dc/transact-async conn [{:db/id bank-account
:bank-account/integration-status
{:db/id (bank-account->integration-id bank-account)
:integration-status/state :integration-state/failed

View File

@@ -296,7 +296,7 @@
:import-batch/not-ready 0
:import-batch/extant 0})
extant-cache (atom (cache/ttl-cache-factory {} :ttl 60000 ))
import-id (get (:tempids @(dc/transact conn [{:db/id "import-batch"
import-id (get (:tempids @(dc/transact-async conn [{:db/id "import-batch"
:import-batch/date (coerce/to-date (t/now))
:import-batch/source source
:import-batch/status :import-status/started
@@ -334,10 +334,10 @@
(fail! [_ error]
(log/errorf "Couldn't complete import %d with error." import-id)
(log/error error)
@(dc/transact conn [(merge {:db/id import-id
:import-batch/status :import-status/completed
:import-batch/error-message (str error)}
@stats)]))
@(dc/transact-async conn [(merge {:db/id import-id
:import-batch/status :import-status/completed
:import-batch/error-message (str error)}
@stats)]))
(finish! [_]
(log/infof "Finishing import batch %d for %s with stats %s " import-id (name source) (pr-str @stats))

View File

@@ -394,7 +394,7 @@
(->
(de/chain (search client location start end)
(fn [search-results]
(->> search-results
(->> (or search-results [])
(s/->source)
(s/filter (fn [order]
;; sometimes orders stay open in square. At least one payment