diff --git a/src/main/java/ch/ethz/seb/sebserver/gbl/model/sebconfig/SEBClientConfig.java b/src/main/java/ch/ethz/seb/sebserver/gbl/model/sebconfig/SEBClientConfig.java index 0c61f1a6..3f3b26ab 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gbl/model/sebconfig/SEBClientConfig.java +++ b/src/main/java/ch/ethz/seb/sebserver/gbl/model/sebconfig/SEBClientConfig.java @@ -506,13 +506,13 @@ public final class SEBClientConfig implements GrantEntity, Activatable { this.lastUpdateUser); } - public static SEBClientConfig createNew(final Long institutionId) { + public static SEBClientConfig createNew(final Long institutionId, final long pingIterval) { return new SEBClientConfig( null, institutionId, null, ConfigPurpose.CONFIGURE_CLIENT, - 1000L, + pingIterval, VDIType.NO, null, null, diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/content/configs/SEBClientConfigForm.java b/src/main/java/ch/ethz/seb/sebserver/gui/content/configs/SEBClientConfigForm.java index be3c58b6..407e242e 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gui/content/configs/SEBClientConfigForm.java +++ b/src/main/java/ch/ethz/seb/sebserver/gui/content/configs/SEBClientConfigForm.java @@ -150,12 +150,14 @@ public class SEBClientConfigForm implements TemplateComposer { private final DownloadService downloadService; private final String downloadFileName; private final Cryptor cryptor; + private final long defaultSEBPingInterval; protected SEBClientConfigForm( final PageService pageService, final DownloadService downloadService, final Cryptor cryptor, - @Value("${sebserver.gui.seb.client.config.download.filename}") final String downloadFileName) { + @Value("${sebserver.gui.seb.client.config.download.filename}") final String downloadFileName, + @Value("${sebserver.gui.seb.client.config.ping.interval:1000}") final long defaultSEBPingInterval) { this.pageService = pageService; this.restService = pageService.getRestService(); @@ -163,6 +165,7 @@ public class SEBClientConfigForm implements TemplateComposer { this.currentUser = pageService.getCurrentUser(); this.downloadService = downloadService; this.downloadFileName = downloadFileName; + this.defaultSEBPingInterval = defaultSEBPingInterval; } @Override @@ -179,7 +182,8 @@ public class SEBClientConfigForm implements TemplateComposer { final SEBClientConfig clientConfig = (isNew) ? SEBClientConfig.createNew((parentEntityKey != null) ? Long.valueOf(parentEntityKey.modelId) - : user.institutionId) + : user.institutionId, + this.defaultSEBPingInterval) : this.restService .getBuilder(GetClientConfig.class) .withURIVariable(API.PARAM_MODEL_ID, entityKey.modelId) diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/SEBClientEventBatchService.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/SEBClientEventBatchService.java index 688ff0a1..0a3fe8ac 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/SEBClientEventBatchService.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/SEBClientEventBatchService.java @@ -97,8 +97,6 @@ public class SEBClientEventBatchService { initialDelay = 100) public void processEvents() { - final long start = Utils.getMillisecondsNow(); - final int size = this.eventDataQueue.size(); if (size > 1000) { log.warn("-----> There are more then 1000 SEB client logs in the waiting queue: {}", size); @@ -137,8 +135,6 @@ public class SEBClientEventBatchService { } catch (final Exception e) { log.error("Failed to process SEB events from eventDataQueue: ", e); } - - System.out.println("************ tuck: " + (Utils.getMillisecondsNow() - start)); } private EventData convertData(final EventData eventData) {