re-added synchronization to look if it has effect
This commit is contained in:
parent
2c197665f0
commit
45e01dc0dd
2 changed files with 22 additions and 7 deletions
|
@ -160,10 +160,16 @@ public class SEBClientEventBatchService {
|
||||||
return eventData;
|
return eventData;
|
||||||
}
|
}
|
||||||
|
|
||||||
System.out.println("******* storeNotifications: " + eventData);
|
ClientConnectionDataInternal clientConnection = null;
|
||||||
|
synchronized (ExamSessionCacheService.CLIENT_CONNECTION_CREATION_LOCK) {
|
||||||
|
clientConnection = this.examSessionCacheService
|
||||||
|
.getClientConnection(eventData.connectionToken);
|
||||||
|
}
|
||||||
|
|
||||||
final ClientConnectionDataInternal clientConnection = this.examSessionCacheService
|
if (clientConnection == null) {
|
||||||
.getClientConnection(eventData.connectionToken);
|
log.error("Failed to get ClientConnectionDataInternal for: {}", eventData.connectionToken);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
final Pair<NotificationType, String> typeAndPlainText =
|
final Pair<NotificationType, String> typeAndPlainText =
|
||||||
ClientNotification.extractTypeAndPlainText(eventData.event.text);
|
ClientNotification.extractTypeAndPlainText(eventData.event.text);
|
||||||
|
@ -200,8 +206,12 @@ public class SEBClientEventBatchService {
|
||||||
|
|
||||||
private ClientEventRecord toEventRecord(final EventData eventData) {
|
private ClientEventRecord toEventRecord(final EventData eventData) {
|
||||||
try {
|
try {
|
||||||
final ClientConnectionDataInternal clientConnection = this.examSessionCacheService
|
|
||||||
.getClientConnection(eventData.connectionToken);
|
ClientConnectionDataInternal clientConnection = null;
|
||||||
|
synchronized (ExamSessionCacheService.CLIENT_CONNECTION_CREATION_LOCK) {
|
||||||
|
clientConnection = this.examSessionCacheService
|
||||||
|
.getClientConnection(eventData.connectionToken);
|
||||||
|
}
|
||||||
|
|
||||||
if (clientConnection == null) {
|
if (clientConnection == null) {
|
||||||
log.warn("Failed to retrieve ClientConnection for token {}. Skip this event",
|
log.warn("Failed to retrieve ClientConnection for token {}. Skip this event",
|
||||||
|
|
|
@ -91,11 +91,16 @@ public class SEBClientPingBatchService {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
final ClientConnectionDataInternal activeClientConnection = this.examSessionCacheService
|
ClientConnectionDataInternal activeClientConnection = null;
|
||||||
.getClientConnection(connectionToken);
|
synchronized (ExamSessionCacheService.CLIENT_CONNECTION_CREATION_LOCK) {
|
||||||
|
activeClientConnection = this.examSessionCacheService
|
||||||
|
.getClientConnection(connectionToken);
|
||||||
|
}
|
||||||
|
|
||||||
if (activeClientConnection != null) {
|
if (activeClientConnection != null) {
|
||||||
activeClientConnection.notifyPing(timestamp);
|
activeClientConnection.notifyPing(timestamp);
|
||||||
|
} else {
|
||||||
|
log.error("Failed to get ClientConnectionDataInternal for: {}", connectionToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (instructionConfirm != StringUtils.EMPTY) {
|
if (instructionConfirm != StringUtils.EMPTY) {
|
||||||
|
|
Loading…
Reference in a new issue