From 2ac17108d67953bf636a54fdeb1d7a9e408b364f Mon Sep 17 00:00:00 2001 From: anhefti Date: Wed, 19 May 2021 11:31:39 +0200 Subject: [PATCH] fixed caching issues evict only in distributed env --- .../session/impl/ExamJITSIProctoringService.java | 3 ++- .../servicelayer/session/impl/ExamSessionServiceImpl.java | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/ExamJITSIProctoringService.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/ExamJITSIProctoringService.java index 63b21282..1d1fae40 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/ExamJITSIProctoringService.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/ExamJITSIProctoringService.java @@ -321,7 +321,8 @@ public class ExamJITSIProctoringService implements ExamProctoringService { long expTime = System.currentTimeMillis() + Constants.DAY_IN_MILLIS; if (this.examSessionService.isExamRunning(examProctoring.examId)) { - final Exam exam = this.examSessionService.getRunningExam(examProctoring.examId) + final Exam exam = this.examSessionService + .getRunningExam(examProctoring.examId) .getOrThrow(); if (exam.endTime != null) { expTime = exam.endTime.getMillis(); diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/ExamSessionServiceImpl.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/ExamSessionServiceImpl.java index abe8d6b1..ba1f822b 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/ExamSessionServiceImpl.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/ExamSessionServiceImpl.java @@ -227,7 +227,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)) {