fixes load from historical sales.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user