Skip to content

Commit

Permalink
Lisää lokitusta hakemusten hakemiseen YTL-ajossa.
Browse files Browse the repository at this point in the history
  • Loading branch information
augustk committed Apr 2, 2024
1 parent c444ae8 commit ba34dd4
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,14 @@ class YtlIntegration(
.map(_.flatten)
}

hakuOids.grouped(10).foldLeft(Future.successful(Set.empty[HetuPersonOid])) {
case (result, chunk) => result.flatMap(rs => fetchChunk(chunk).map(rs ++ _))
val hakuOidsChunkSize = 10
hakuOids.zipWithIndex.grouped(hakuOidsChunkSize).foldLeft(Future.successful(Set.empty[HetuPersonOid])) {
case (result, chunkWithIndex) => {
val chunk = chunkWithIndex.map(_._1)
val firstIndex = chunkWithIndex.map(_._2).head
logger.info(s"Fetching hakuOid chunk. First hakuOid is ${firstIndex}/${hakuOids.size} (Chunk size is ${hakuOidsChunkSize} and hakuOids are ${chunk})")
result.flatMap(rs => fetchChunk(chunk).map(rs ++ _))
}
}
}

Expand Down

0 comments on commit ba34dd4

Please sign in to comment.