diff --git a/src/clj/auto_ap/jobs/restore_from_backup.clj b/src/clj/auto_ap/jobs/restore_from_backup.clj index 9177a5cc..738f1724 100644 --- a/src/clj/auto_ap/jobs/restore_from_backup.clj +++ b/src/clj/auto_ap/jobs/restore_from_backup.clj @@ -76,7 +76,7 @@ (mu/log ::error :exception e) (throw e))))) - (->> (partition-all 1000 entities) + (->> (partition-all 200 entities) (s/->source) (s/onto buffered) (s/map (fn [entities] @@ -84,7 +84,7 @@ (reset! die? false) (throw (Exception. "dead"))) (upsert-batch entities))) - (s/buffer 50) + (s/buffer 20) (s/realize-each))) (swap! loaded conj entity)))) diff --git a/src/clj/auto_ap/ledger.clj b/src/clj/auto_ap/ledger.clj index 9d330f2d..48005177 100644 --- a/src/clj/auto_ap/ledger.clj +++ b/src/clj/auto_ap/ledger.clj @@ -532,13 +532,13 @@ (-> je :journal-entry/date)]}) (:journal-entry/line-items je)))) - (partition-all 500) + (partition-all 200) (s/->source) (s/map (fn [batch] (de/future (dc/transact conn {:tx-data batch}) (count batch)))) - (s/buffer 50) + (s/buffer 20) (s/realize-each) (s/consume (fn [batch-count] (swap! so-far #(+ % batch-count)) @@ -694,13 +694,13 @@ (s/realize-each) (s/mapcat (fn [x] x)) - (s/buffer 50) - (s/transform (partition-all 500)) + (s/buffer 20) + (s/transform (partition-all 200)) (s/map (fn [batch] (de/future (dc/transact conn {:tx-data batch}) (count batch)))) - (s/buffer 50) + (s/buffer 20) (s/realize-each) (s/consume (fn [batch-count] (swap! so-far #(+ % batch-count))