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]