Skip to content

Commit

Permalink
CMR-7185-1 working on a Out Of Memory Error. using much smaller batch…
Browse files Browse the repository at this point in the history
…es. (#1474)
  • Loading branch information
eereiter authored Feb 28, 2022
1 parent b49b645 commit 70795af
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion common-app-lib/src/cmr/common_app/services/kms_lookup.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion indexer-app/src/cmr/indexer/services/autocomplete.clj
Original file line number Diff line number Diff line change
Expand Up @@ -203,14 +203,16 @@
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]
(info "Reindexing autocomplete suggestions for provider" provider-id)
(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)]
Expand Down

0 comments on commit 70795af

Please sign in to comment.