Should give a bit more clarity if refunds don't load

This commit is contained in:
2023-03-03 10:03:16 -08:00
parent eb87367e8b
commit 0ff147a7a0

View File

@@ -592,16 +592,24 @@
:when (:square-location/client-location square-location)] :when (:square-location/client-location square-location)]
(upsert-refunds client square-location)))) (upsert-refunds client square-location))))
([client location] ([client location]
(with-context-as {:source "Square refunds loading"
:client (:client/code client)} lc
(de/chain (refunds client location) (de/chain (refunds client location)
(fn [refunds] (fn [refunds]
(mu/with-context {:source "Loading Square Settlements" (mu/with-context lc
:client (:client/code client) (try
:location (:square-location/client-location client)}
(doseq [x (partition-all 100 refunds)] (doseq [x (partition-all 100 refunds)]
(log/info ::loading-refunds (log/info ::loading-refunds
:count (count x)) :count (count x)
:sample (first x))
@(d/transact conn x)) @(d/transact conn x))
(log/info ::done-loading-refunds))))))
(catch Throwable e
(log/error ::upsert-refunds-failed
:exception e)))
(log/info ::done-loading-refunds)))))))
(def square-read [:db/id (def square-read [:db/id
:client/code :client/code