Skip to content

Commit

Permalink
Merge pull request #385 from lichess-org/fix/oom
Browse files Browse the repository at this point in the history
Revert "Use all instead of compile.stream.toList"
  • Loading branch information
lenguyenthanh authored Dec 4, 2024
2 parents 47ea964 + eb0f977 commit c790abf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion modules/ingestor/src/main/scala/mongo.chapter.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit c790abf

Please sign in to comment.