Merge branch 'dev-1.3' into development

This commit is contained in:
anhefti 2022-03-24 16:47:19 +01:00
commit fec8c4868a
5 changed files with 16 additions and 7 deletions

View file

@ -137,7 +137,8 @@ public class ClientConnectionDetails {
final ClientConnectionData connectionData = this.restCallBuilder
.call()
.get(error -> {
log.error("Unexpected error while trying to get current client connection data: ", error);
log.error("Unexpected error while trying to get current client connection data: {}",
error.getMessage());
recoverFromDisposedRestTemplate(error);
return null;
});

View file

@ -148,7 +148,9 @@ public class ExamSessionCacheService {
if (clientConnection == null) {
return null;
} else {
return this.internalClientConnectionDataFactory.createClientConnectionData(clientConnection);
return this.internalClientConnectionDataFactory.createClientConnectionData(
clientConnection,
this.getRunningExam(clientConnection.examId) != null);
}
}

View file

@ -32,7 +32,16 @@ public class InternalClientConnectionDataFactory {
this.sebClientNotificationService = sebClientNotificationService;
}
public ClientConnectionDataInternal createClientConnectionData(final ClientConnection clientConnection) {
public ClientConnectionDataInternal createClientConnectionData(
final ClientConnection clientConnection,
final boolean examRunning) {
if (!examRunning) {
return new ClientConnectionDataInternal(
clientConnection,
() -> false,
this.clientIndicatorFactory.createFor(clientConnection, true));
}
if (clientConnection.status == ConnectionStatus.CLOSED
|| clientConnection.status == ConnectionStatus.DISABLED) {

View file

@ -287,10 +287,6 @@ public class DistributedIndicatorValueService implements DisposableBean {
if (value == null) {
try {
if (log.isDebugEnabled()) {
log.debug("*** Get and cache ping time: {}", indicatorPK);
}
value = this.clientIndicatorValueMapper.selectValueByPrimaryKey(indicatorPK);
if (value != null) {
this.indicatorValueCache.put(indicatorPK, value);

View file

@ -87,6 +87,7 @@ public final class PingIntervalClientIndicator extends AbstractPingIndicator {
final long currentTimeMillis = DateTimeUtils.currentTimeMillis();
this.currentValue = computeValueAt(currentTimeMillis);
this.lastUpdate = this.distributedPingCache.lastUpdate();
return (currentTimeMillis < this.currentValue)
? DateTimeUtils.currentTimeMillis() - this.currentValue
: currentTimeMillis - this.currentValue;