fixed cache issue

do not evict the cache before get exams for institution otherwise
connecting SEB clients will always reload all running exams form
institution
This commit is contained in:
anhefti 2021-05-19 11:06:50 +02:00
parent 3a06f9937f
commit 8daf39a177

View file

@ -250,10 +250,8 @@ public class ExamSessionServiceImpl implements ExamSessionService {
@Override
public Result<Collection<Exam>> getRunningExamsForInstitution(final Long institutionId) {
// NOTE: we evict the exam from the cache (if present) to ensure user is seeing always the current state of the Exam
return this.examDAO.allIdsOfInstitution(institutionId)
.map(col -> col.stream()
.map(this.examSessionCacheService::evict)
.map(this::getRunningExam)
.filter(Result::hasValue)
.map(Result::get)