From 9708d8610b33970af7dbc99509b233b01da04edf Mon Sep 17 00:00:00 2001 From: anhefti Date: Tue, 30 May 2023 15:40:17 +0200 Subject: [PATCH] SEBSERV-445 removed synchronized SEB connection cache access --- .../session/impl/ExamSessionServiceImpl.java | 6 +++--- .../weblayer/api/ExamMonitoringController.java | 12 ++++++++++-- 2 files changed, 13 insertions(+), 5 deletions(-) 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 d8d89ff9..7ca45549 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 @@ -378,9 +378,9 @@ public class ExamSessionServiceImpl implements ExamSessionService { @Override public ClientConnectionDataInternal getConnectionDataInternal(final String connectionToken) { - synchronized (ExamSessionCacheService.CLIENT_CONNECTION_CREATION_LOCK) { - return this.examSessionCacheService.getClientConnection(connectionToken); - } + //synchronized (ExamSessionCacheService.CLIENT_CONNECTION_CREATION_LOCK) { + return this.examSessionCacheService.getClientConnection(connectionToken); + //} } @Override diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/ExamMonitoringController.java b/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/ExamMonitoringController.java index 36aec030..b5b70eab 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/ExamMonitoringController.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/ExamMonitoringController.java @@ -314,6 +314,8 @@ public class ExamMonitoringController { name = API.EXAM_MONITORING_CLIENT_GROUP_FILTER, required = false) final String hiddenClientGroups) { + final long now = Utils.getMillisecondsNow(); + final Exam runningExam = checkPrivileges(institutionId, examId); final MonitoringSEBConnectionData monitoringSEBConnectionData = this.examSessionService @@ -322,21 +324,27 @@ public class ExamMonitoringController { createMonitoringFilter(hiddenStates, hiddenClientGroups)) .getOrThrow(); + MonitoringFullPageData monitoringFullPageData; if (this.examAdminService.isProctoringEnabled(runningExam).getOr(false)) { final Collection proctoringData = this.examProcotringRoomService .getProctoringCollectingRooms(examId) .getOrThrow(); - return new MonitoringFullPageData( + monitoringFullPageData = new MonitoringFullPageData( examId, monitoringSEBConnectionData, proctoringData); + } else { - return new MonitoringFullPageData( + monitoringFullPageData = new MonitoringFullPageData( examId, monitoringSEBConnectionData, Collections.emptyList()); } + + System.out.println("%%%%%%%% --> monitoring tuck: " + (Utils.getMillisecondsNow() - now)); + + return monitoringFullPageData; } @RequestMapping(