Skip to content

Commit afce89c

Browse files
committed
CMR-11070: CodeRabbit pr feedback
1 parent 9f7a494 commit afce89c

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

‎indexer-app/src/cmr/indexer/services/index_set_service.clj‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,9 @@
582582
(when (= "small-collections" target)
583583
(let [collection-key (keyword concept-id)
584584
old-separate-index (get-in old-gran-index-set [:index-set :concepts :granule collection-key])]
585-
(es/delete-index es-store old-separate-index)))
585+
(if old-separate-index
586+
(es/delete-index es-store old-separate-index)
587+
(warn (format "No separate index found for [%s] in old index-set; skipping deletion." concept-id)))))
586588
(catch Exception e
587589
(error e (format "Failed to finalize rebalancing for [%s] -> [%s]" concept-id target))
588590
(errors/throw-service-error :internal-error

‎metadata-db-app/src/cmr/metadata_db/data/memory_db.clj‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@
289289
provider-id (:provider-id provider)
290290
concepts @(:concepts-atom db)
291291
filtered-concepts (concepts/search-with-params concepts (assoc params :provider-id provider-id))
292-
sorted-concepts (vec (sort-by :id filtered-concepts))
292+
sorted-concepts (vec (sort-by :concept-id filtered-concepts))
293293
start-index (max requested-start-index 0)]
294294
(letfn [(find-batch [start-index]
295295
(let [end-index (min (+ start-index batch-size) (count sorted-concepts))
@@ -714,5 +714,6 @@
714714
(doseq [batch batches]
715715
(println "Batch:")
716716
(doseq [concept batch]
717-
(println (select-keys concept [:concept-id :native-id]))) (println))) (println)))
717+
(println (select-keys concept [:concept-id :native-id]))) (println))
718+
)
718719

0 commit comments

Comments
 (0)