File tree Expand file tree Collapse file tree 3 files changed +30
-11
lines changed
src/main/java/ch/ethz/seb/sps/server/servicelayer/impl Expand file tree Collapse file tree 3 files changed +30
-11
lines changed Original file line number Diff line number Diff line change 1616 <packaging >jar</packaging >
1717
1818 <properties >
19- <seb-sps-version >1.2.1 </seb-sps-version >
19+ <seb-sps-version >1.2.3_SNAPSHOT </seb-sps-version >
2020 <build-version >${seb-sps-version} </build-version >
2121 <revision >${seb-sps-version}</revision >
2222 <project .build.sourceEncoding>UTF-8</project .build.sourceEncoding>
Original file line number Diff line number Diff line change @@ -112,7 +112,22 @@ public void checkMonitoringSessionAccess(final String sessionUUID) {
112112 public synchronized Result <ScreenshotViewData > getRecordedImageDataAt (final String sessionUUID , final Long timestamp ) {
113113 return Result .tryCatch (() -> {
114114
115- boolean sessionActive = this .proctoringCacheService .getSession (sessionUUID ).isActive ();
115+ Session session = this .proctoringCacheService .getSession (sessionUUID );
116+ if (session == null ) {
117+ log .warn ("Failed to get Session for: {}" , sessionUUID );
118+ throw new NoResourceFoundException (EntityType .SCREENSHOT_DATA , sessionUUID );
119+ }
120+
121+ // NOTE: if we have a distributed setup, refresh the cache to be sure we have the actual session from DB
122+ // TODO This is patch fix for SEBSP-217 and should be handled by overall session cache update for
123+ // distributed setup within the next release version
124+ if (isDistributedSetup ) {
125+ proctoringCacheService .evictSession (sessionUUID );
126+ session = this .proctoringCacheService .getSession (sessionUUID );
127+ }
128+
129+ boolean sessionActive = session .isActive ();
130+
116131
117132 if (timestamp == null ) {
118133 // this means last timestamp and only should be called on live recording views
Original file line number Diff line number Diff line change @@ -165,17 +165,21 @@ public void storeScreenshot(
165165 }
166166
167167 private void processStore (final Collection <ScreenshotQueueData > batch ) {
168- batch .clear ();
169- this .screenshotDataQueue .drainTo (batch );
168+ try {
169+ batch .clear ();
170+ this .screenshotDataQueue .drainTo (batch );
170171
171- if (batch .isEmpty ()) {
172- return ;
173- }
172+ if (batch .isEmpty ()) {
173+ return ;
174+ }
174175
175- if (batchStore ) {
176- applyBatchStore (batch );
177- } else {
178- applySingleStore (batch );
176+ if (batchStore ) {
177+ applyBatchStore (batch );
178+ } else {
179+ applySingleStore (batch );
180+ }
181+ } catch (Exception e ) {
182+ log .error ("Failed to drain and process batch - should never happen: " , e );
179183 }
180184 }
181185
You can’t perform that action at this time.
0 commit comments