From 68bd112c069cea899bb4dbb0a76bf06655481c53 Mon Sep 17 00:00:00 2001 From: Bryce Date: Fri, 9 Jun 2023 12:03:57 -0700 Subject: [PATCH] supports batch update --- src/clj/auto_ap/graphql/ledger.clj | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/clj/auto_ap/graphql/ledger.clj b/src/clj/auto_ap/graphql/ledger.clj index 77c3f03d..da2573ce 100644 --- a/src/clj/auto_ap/graphql/ledger.clj +++ b/src/clj/auto_ap/graphql/ledger.clj @@ -530,10 +530,17 @@ (when (seq ignore-retraction) (audit-transact-batch ignore-retraction (:id context)))) #_(log/info (map :tx success)) - (mu/trace ::success-tx - [:count (count success)] - (doseq [[_ n] (:tempids (audit-transact-batch (map :tx success) (:id context)))] - (solr/touch n))) + (let [invalidated + (mu/trace ::success-tx + [:count (count success)] + (for [[_ n] (:tempids (audit-transact-batch (map :tx success) (:id context)))] + n))] + (future + (mu/log ::indexing-solr :count (count invalidated)) + (mu/trace ::indexed-external-solr + [:count (count invalidated)] + (doseq [n invalidated] + (solr/touch n))))) {:successful (map (fn [x] {:external_id (:external_id x)}) success) :ignored (map (fn [x]