Skip to content

Commit

Permalink
refactor groupAndConvertItemsToCheckpointWithPartitioningDTOs
Browse files Browse the repository at this point in the history
  • Loading branch information
salamonpavel committed Nov 22, 2024
1 parent 0c520c5 commit 7e4513a
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,8 @@ object CheckpointItemWithPartitioningFromDB {

val result = orderedCheckpointIds.map { id => fromItemsToCheckpointWithPartitioningDTO(groupedItems(id)) }

val errors = result.collect { case Left(err) => err }
if (errors.nonEmpty) {
Left(errors.head)
} else {
Right(result.collect { case Right(dto) => dto })
}
val error = result.collectFirst { case Left(err) => Left(err) }
error.getOrElse(Right(result.collect { case Right(dto) => dto }))
}

}

0 comments on commit 7e4513a

Please sign in to comment.