From 70795af7842b41d8c2ef12986d3b119ad9a23f80 Mon Sep 17 00:00:00 2001 From: eereiter Date: Mon, 28 Feb 2022 15:16:25 -0500 Subject: [PATCH] CMR-7185-1 working on a Out Of Memory Error. using much smaller batches. (#1474) --- common-app-lib/src/cmr/common_app/services/kms_lookup.clj | 2 +- indexer-app/src/cmr/indexer/services/autocomplete.clj | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/common-app-lib/src/cmr/common_app/services/kms_lookup.clj b/common-app-lib/src/cmr/common_app/services/kms_lookup.clj index 0e3fe3da18..1807d10301 100644 --- a/common-app-lib/src/cmr/common_app/services/kms_lookup.clj +++ b/common-app-lib/src/cmr/common_app/services/kms_lookup.clj @@ -156,7 +156,7 @@ "Takes a kms-index, the keyword scheme, and a short name and returns the full KMS hierarchy for that short name. Comparison is made case insensitively." [kms-index keyword-scheme short-name] - (get-in kms-index [:short-name-index keyword-scheme (str/lower-case short-name)])) + (get-in kms-index [:short-name-index keyword-scheme (util/safe-lowercase short-name)])) (defn lookup-by-location-string "Takes a kms-index and a location string and returns the full KMS hierarchy for that location diff --git a/indexer-app/src/cmr/indexer/services/autocomplete.clj b/indexer-app/src/cmr/indexer/services/autocomplete.clj index d13762068e..4766bd20b9 100644 --- a/indexer-app/src/cmr/indexer/services/autocomplete.clj +++ b/indexer-app/src/cmr/indexer/services/autocomplete.clj @@ -203,6 +203,8 @@ flatten (remove anti-value-suggestion?)))) +(def REINDEX_BATCH_SIZE 100) + (defn-timed reindex-autocomplete-suggestions-for-provider "Reindex autocomplete suggestion for a given provider" [context provider-id] @@ -210,7 +212,7 @@ (let [latest-collection-batches (meta-db/find-in-batches context :collection - service/REINDEX_BATCH_SIZE + REINDEX_BATCH_SIZE {:provider-id provider-id :latest true})] (reduce (fn [num-indexed coll-batch] (let [batch (collections->suggestion-docs context coll-batch provider-id)]