Merge remote-tracking branch 'origin/dev-1.1-patch-1' into development

Conflicts:
	src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/ExamJITSIProctoringService.java
This commit is contained in:
anhefti 2021-05-19 11:56:20 +02:00
commit 39e8846f64
2 changed files with 6 additions and 5 deletions

View file

@ -151,8 +151,8 @@ public class ExamSessionCacheService {
unless = "#result == null")
public ClientConnectionDataInternal getClientConnection(final String connectionToken) {
if (log.isDebugEnabled()) {
log.debug("Verify ClientConnection for running exam for caching by connectionToken: {}", connectionToken);
if (log.isTraceEnabled()) {
log.trace("Verify ClientConnection for running exam for caching by connectionToken: {}", connectionToken);
}
final ClientConnection clientConnection = getClientConnectionByToken(connectionToken);

View file

@ -207,7 +207,10 @@ public class ExamSessionServiceImpl implements ExamSessionService {
log.trace("Running exam request for exam {}", examId);
}
updateExamCache(examId);
if (this.distributedSetup) {
updateExamCache(examId);
}
final Exam exam = this.examSessionCacheService.getRunningExam(examId);
if (this.examSessionCacheService.isRunning(exam)) {
@ -230,10 +233,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)