fixed flatMap bug

This commit is contained in:
anhefti 2022-02-02 12:29:01 +01:00
parent 983fb7d8ea
commit 270d7a2282

View file

@ -312,9 +312,7 @@ public class ExamConfigUpdateServiceImpl implements ExamConfigUpdateService {
private Collection<Result<Exam>> lockForUpdate(final Collection<Long> examIds, final String update) {
return examIds.stream()
.map(id -> this.examDAO.byPK(id)
.map(exam -> this.examDAO.placeLock(exam, update))
.getOrThrow())
.map(id -> this.examDAO.byPK(id).flatMap(exam -> this.examDAO.placeLock(exam, update)))
.collect(Collectors.toList());
}