to get rid of "magic" time constants

This commit is contained in:
igor-suhorukov
2018-03-08 21:30:45 +03:00
committed by Juergen Hoeller
parent ed7684d2b2
commit 407ecf7334
7 changed files with 16 additions and 11 deletions

View File

@@ -75,7 +75,7 @@ public class WebSocketMessageBrokerStats {
@Nullable
private ScheduledFuture<?> loggingTask;
private long loggingPeriod = 30 * 60 * 1000;
private long loggingPeriod = TimeUnit.MINUTES.toMillis(30);
public void setSubProtocolWebSocketHandler(SubProtocolWebSocketHandler webSocketHandler) {
@@ -114,7 +114,7 @@ public class WebSocketMessageBrokerStats {
public void setSockJsTaskScheduler(ThreadPoolTaskScheduler sockJsTaskScheduler) {
this.sockJsTaskScheduler = sockJsTaskScheduler.getScheduledThreadPoolExecutor();
this.loggingTask = initLoggingTask(60 * 1000);
this.loggingTask = initLoggingTask(TimeUnit.MINUTES.toMillis(1));
}
@Nullable

View File

@@ -87,9 +87,9 @@ public abstract class AbstractSockJsService implements SockJsService, CorsConfig
private boolean sessionCookieNeeded = true;
private long heartbeatTime = 25 * 1000;
private long heartbeatTime = TimeUnit.SECONDS.toMillis(25);
private long disconnectDelay = 5 * 1000;
private long disconnectDelay = TimeUnit.SECONDS.toMillis(5 );
private int httpMessageCacheSize = 100;