aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-batch/src/main/java/org/sonar
diff options
context:
space:
mode:
authorJulien HENRY <julien.henry@sonarsource.com>2013-07-15 14:59:16 +0200
committerJulien HENRY <julien.henry@sonarsource.com>2013-07-15 14:59:16 +0200
commit31ebbfb9cef7a3259f99593d0be53474841cb42b (patch)
treed247e5d484b4e12d04e016fddd24b9e6f44da1d4 /sonar-batch/src/main/java/org/sonar
parent7a831a38975b83b0cbbf81dcbb9971e696935e2d (diff)
downloadsonarqube-31ebbfb9cef7a3259f99593d0be53474841cb42b.tar.gz
sonarqube-31ebbfb9cef7a3259f99593d0be53474841cb42b.zip
SONAR-4488 Make sonar.dryRun.readTimeout property take seconds as input
Diffstat (limited to 'sonar-batch/src/main/java/org/sonar')
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/bootstrap/DryRunDatabase.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/DryRunDatabase.java b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/DryRunDatabase.java
index 20a8d9ef8f2..9be2c5301a2 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/DryRunDatabase.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/DryRunDatabase.java
@@ -46,7 +46,7 @@ public class DryRunDatabase implements BatchComponent {
private static final String USER = "sonar";
private static final String PASSWORD = "sonar";
- private static final int DEFAULT_DRY_RUN_READ_TIMEOUT = 60 * 1000;
+ private static final int DEFAULT_DRY_RUN_READ_TIMEOUT_SEC = 60;
private final Settings settings;
private final ServerClient server;
@@ -64,10 +64,10 @@ public class DryRunDatabase implements BatchComponent {
File databaseFile = tempDirectories.getFile("", "dryrun.h2.db");
// SONAR-4488 Allow to increase dryRun timeout
- int readTimeout = settings.getInt(CoreProperties.DRY_RUN_READ_TIMEOUT);
- readTimeout = (readTimeout == 0) ? DEFAULT_DRY_RUN_READ_TIMEOUT : readTimeout;
+ int readTimeoutSec = settings.getInt(CoreProperties.DRY_RUN_READ_TIMEOUT_SEC);
+ readTimeoutSec = (readTimeoutSec == 0) ? DEFAULT_DRY_RUN_READ_TIMEOUT_SEC : readTimeoutSec;
- downloadDatabase(databaseFile, readTimeout);
+ downloadDatabase(databaseFile, readTimeoutSec * 1000);
String databasePath = StringUtils.removeEnd(databaseFile.getAbsolutePath(), ".h2.db");
replaceSettings(databasePath);
@@ -99,7 +99,7 @@ public class DryRunDatabase implements BatchComponent {
if (rootCause instanceof SocketTimeoutException) {
// Pico will unwrap the first runtime exception
throw new SonarException(new SonarException(String.format("DryRun database read timed out after %s ms. You can try to increase read timeout with property -D"
- + CoreProperties.DRY_RUN_READ_TIMEOUT,
+ + CoreProperties.DRY_RUN_READ_TIMEOUT_SEC + "(in seconds)",
readTimeout), e));
}
if (projectKey != null && (rootCause instanceof HttpException) && (((HttpException) rootCause).getResponseCode() == 401)) {