diff options
author | Harald Musum <musum@verizonmedia.com> | 2020-11-20 12:52:43 +0100 |
---|---|---|
committer | Harald Musum <musum@verizonmedia.com> | 2020-11-20 12:52:43 +0100 |
commit | 779bc098071ed33d56373aacc3c303568eb2a933 (patch) | |
tree | 4fda7548ce1913cbefa6897fd13b4bc48a3bf703 /configserver | |
parent | ce9ccaf1a95050f1df8b0c9be3c1daab7dc416fe (diff) |
Log every 10th run of SessionsMaintainer
Diffstat (limited to 'configserver')
-rw-r--r-- | configserver/src/main/java/com/yahoo/vespa/config/server/maintenance/SessionsMaintainer.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/maintenance/SessionsMaintainer.java b/configserver/src/main/java/com/yahoo/vespa/config/server/maintenance/SessionsMaintainer.java index 19534bba810..c7d09b903b0 100644 --- a/configserver/src/main/java/com/yahoo/vespa/config/server/maintenance/SessionsMaintainer.java +++ b/configserver/src/main/java/com/yahoo/vespa/config/server/maintenance/SessionsMaintainer.java @@ -1,4 +1,4 @@ -// Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.config.server.maintenance; import com.yahoo.log.LogLevel; @@ -17,6 +17,7 @@ import java.time.Duration; */ public class SessionsMaintainer extends ConfigServerMaintainer { private final boolean hostedVespa; + private int iteration = 0; SessionsMaintainer(ApplicationRepository applicationRepository, Curator curator, Duration interval, FlagSource flagSource) { super(applicationRepository, curator, flagSource, Duration.ofMinutes(1), interval); @@ -25,6 +26,9 @@ public class SessionsMaintainer extends ConfigServerMaintainer { @Override protected boolean maintain() { + if (iteration % 10 == 0) + log.log(LogLevel.INFO, () -> "Running " + SessionsMaintainer.class.getSimpleName()); + applicationRepository.deleteExpiredLocalSessions(); if (hostedVespa) { @@ -33,6 +37,7 @@ public class SessionsMaintainer extends ConfigServerMaintainer { log.log(LogLevel.FINE, () -> "Deleted " + deleted + " expired remote sessions older than " + expiryTime); } + iteration++; return true; } |