aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-batch
diff options
context:
space:
mode:
authorDuarte Meneses <duarte.meneses@sonarsource.com>2015-08-24 16:08:08 +0200
committerDuarte Meneses <duarte.meneses@sonarsource.com>2015-08-24 16:20:06 +0200
commitdcadad0669ec58d81bb9d986c99635916e5d4a0a (patch)
tree9335b7735f002588cec5c9ee758b323483a322ff /sonar-batch
parente7379601e0c03593d80f0877fdd306ab06a2b6a5 (diff)
downloadsonarqube-dcadad0669ec58d81bb9d986c99635916e5d4a0a.tar.gz
sonarqube-dcadad0669ec58d81bb9d986c99635916e5d4a0a.zip
Fix project lock in Windows
Diffstat (limited to 'sonar-batch')
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/scan/ProjectLock.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/sonar-batch/src/main/java/org/sonar/batch/scan/ProjectLock.java b/sonar-batch/src/main/java/org/sonar/batch/scan/ProjectLock.java
index a373763a361..695fbb687b2 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/scan/ProjectLock.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/scan/ProjectLock.java
@@ -69,7 +69,6 @@ public class ProjectLock implements Startable {
public void stop() {
if (lockFile != null) {
try {
- Files.delete(lockFilePath);
lockFile.release();
lockFile = null;
} catch (IOException e) {
@@ -92,10 +91,18 @@ public class ProjectLock implements Startable {
LOG.error("Error closing file", e);
}
}
+
+ try {
+ Files.delete(lockFilePath);
+ } catch (IOException e) {
+ //ignore, as an error happens if another process just started to acquire the same lock
+ LOG.debug("Couldn't delete lock file: " + lockFilePath.toString(), e);
+ }
}
@Override
public void start() {
+ // nothing to do
}
}