From 79ea9fce719ccc1dfd5d56f43733f507afc9c470 Mon Sep 17 00:00:00 2001 From: Matt Hicks Date: Wed, 1 Jan 2025 08:19:42 -0600 Subject: [PATCH] Minor cleanup --- core/src/main/scala/lightdb/store/split/SplitStore.scala | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/core/src/main/scala/lightdb/store/split/SplitStore.scala b/core/src/main/scala/lightdb/store/split/SplitStore.scala index 5b457d0..6f8e934 100644 --- a/core/src/main/scala/lightdb/store/split/SplitStore.scala +++ b/core/src/main/scala/lightdb/store/split/SplitStore.scala @@ -95,12 +95,11 @@ case class SplitStore[Doc <: Document[Doc], Model <: DocumentModel[Doc]](overrid reIndexInternal().map(_ => true) } - private def reIndexInternal()(implicit transaction: Transaction[Doc]): Task[Unit] = { - // TODO: Process concurrently - searching.truncate().flatMap { _ => + private def reIndexInternal()(implicit transaction: Transaction[Doc]): Task[Unit] = searching + .truncate() + .flatMap { _ => storage.stream.evalMap(searching.insert).drain } - } override def dispose(): Task[Unit] = storage.dispose().and(searching.dispose()).unit }