From eb0f9771b1cf224eddb7bb039d237dc4406e31b3 Mon Sep 17 00:00:00 2001 From: Thanh Le Date: Wed, 4 Dec 2024 17:53:27 +0100 Subject: [PATCH] Revert "Use all instead of compile.stream.toList" This reverts commit cd4a64850ac9865a09d9acc17ee6cfda43b2b386. --- modules/ingestor/src/main/scala/mongo.chapter.scala | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/ingestor/src/main/scala/mongo.chapter.scala b/modules/ingestor/src/main/scala/mongo.chapter.scala index bd90dad..1a05e78 100644 --- a/modules/ingestor/src/main/scala/mongo.chapter.scala +++ b/modules/ingestor/src/main/scala/mongo.chapter.scala @@ -110,6 +110,9 @@ object ChapterRepo: def byStudyIds(ids: List[String]): IO[Map[String, StudyData]] = coll .aggregateWithCodec[StudyData](Query.aggregate(ids)) - .all // .flatTap(docs => Logger[IO].debug(s"Received $docs chapters")) + .stream + .compile + .toList + .flatTap(docs => Logger[IO].debug(s"Received $docs chapters")) .map(_.map(x => x._id -> x).toMap)