diff options
author | Sébastien Lesaint <sebastien.lesaint@sonarsource.com> | 2019-05-07 14:54:51 +0200 |
---|---|---|
committer | SonarTech <sonartech@sonarsource.com> | 2019-06-03 20:21:21 +0200 |
commit | 37fd266fb3d3fd1965580e1a8038f3ea9fe53b8a (patch) | |
tree | 866174c48d1e00d7893e833798df4117f80ba686 /server/sonar-ce | |
parent | ef72cd98a1dc1044e59021e3999857309902d718 (diff) | |
download | sonarqube-37fd266fb3d3fd1965580e1a8038f3ea9fe53b8a.tar.gz sonarqube-37fd266fb3d3fd1965580e1a8038f3ea9fe53b8a.zip |
SONAR-12043 graceful shutdown timeout configurable for ITs
Diffstat (limited to 'server/sonar-ce')
-rw-r--r-- | server/sonar-ce/src/main/java/org/sonar/ce/configuration/CeConfigurationImpl.java | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/server/sonar-ce/src/main/java/org/sonar/ce/configuration/CeConfigurationImpl.java b/server/sonar-ce/src/main/java/org/sonar/ce/configuration/CeConfigurationImpl.java index 3fb2be0c29c..f4427dca3b9 100644 --- a/server/sonar-ce/src/main/java/org/sonar/ce/configuration/CeConfigurationImpl.java +++ b/server/sonar-ce/src/main/java/org/sonar/ce/configuration/CeConfigurationImpl.java @@ -25,14 +25,12 @@ import org.sonar.api.config.Configuration; import org.sonar.api.utils.MessageException; import static java.lang.String.format; +import static org.sonar.process.ProcessProperties.Property.CE_GRACEFUL_STOP_TIMEOUT; /** * Immutable implementation of {@link CeConfiguration} initialized at startup from {@link Configuration}. */ public class CeConfigurationImpl implements CeConfiguration { - private static final String SONAR_CE_GRACEFUL_STOP_TIME_OUT_IN_MS = "sonar.ce.gracefulStopTimeOutInMs"; - // 6 hours - private static final long DEFAULT_TASK_TIMEOUT_IN_MS = 6 * 60 * 60 * 1_000L; private static final int DEFAULT_WORKER_THREAD_COUNT = 1; private static final int MAX_WORKER_THREAD_COUNT = 10; private static final int DEFAULT_WORKER_COUNT = 1; @@ -55,8 +53,8 @@ public class CeConfigurationImpl implements CeConfiguration { public CeConfigurationImpl(Configuration configuration, @Nullable WorkerCountProvider workerCountProvider) { this.workerCountProvider = workerCountProvider; - this.gracefulStopTimeoutInMs = configuration.getLong(SONAR_CE_GRACEFUL_STOP_TIME_OUT_IN_MS) - .orElse(DEFAULT_TASK_TIMEOUT_IN_MS); + this.gracefulStopTimeoutInMs = configuration.getLong(CE_GRACEFUL_STOP_TIMEOUT.getKey()) + .orElse(Long.parseLong(CE_GRACEFUL_STOP_TIMEOUT.getDefaultValue())); if (workerCountProvider == null) { this.workerCount = DEFAULT_WORKER_COUNT; this.workerThreadCount = DEFAULT_WORKER_THREAD_COUNT; |