aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-batch/src/main/java/org
diff options
context:
space:
mode:
Diffstat (limited to 'sonar-batch/src/main/java/org')
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/bootstrap/ProjectLock.java14
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/bootstrap/TaskContainer.java2
2 files changed, 4 insertions, 12 deletions
diff --git a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/ProjectLock.java b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/ProjectLock.java
index b0bd127b6d7..8a4d2148d6d 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/ProjectLock.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/ProjectLock.java
@@ -58,9 +58,7 @@ public class ProjectLock {
DurationLabel durationLabel = new DurationLabel();
String durationDisplay = durationLabel.label(duration);
- return "It looks like an analysis of '" + getProject().getName() + "' is already running (started " + durationDisplay + "). " +
- "If this is not the case, it probably means that previous analysis was interrupted " +
- "and you should then force a re-run by using the option '" + CoreProperties.FORCE_ANALYSIS + "=true'.";
+ return "It looks like an analysis of '" + getProject().getName() + "' is already running (started " + durationDisplay + ").";
}
public void stop() {
@@ -71,11 +69,7 @@ public class ProjectLock {
private Semaphores.Semaphore acquire() {
LOG.debug("Acquire semaphore on project : {}, with key {}", getProject(), getSemaphoreKey());
- if (shouldForce()) {
- // In force mode, we acquire the lock regardless there's a existing lock or not
- return semaphores.acquire(getSemaphoreKey(), 0);
- }
- return semaphores.acquire(getSemaphoreKey());
+ return semaphores.acquire(getSemaphoreKey(), 15, 10);
}
private void release() {
@@ -94,8 +88,4 @@ public class ProjectLock {
private boolean isInDryRunMode() {
return settings.getBoolean(CoreProperties.DRY_RUN);
}
-
- private boolean shouldForce() {
- return settings.getBoolean(CoreProperties.FORCE_ANALYSIS);
- }
}
diff --git a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/TaskContainer.java b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/TaskContainer.java
index 3b754d15b34..83fe47a2b02 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/TaskContainer.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/TaskContainer.java
@@ -58,6 +58,7 @@ import org.sonar.core.notification.DefaultNotificationManager;
import org.sonar.core.persistence.DaoUtils;
import org.sonar.core.persistence.DatabaseVersion;
import org.sonar.core.persistence.MyBatis;
+import org.sonar.core.persistence.SemaphoreUpdater;
import org.sonar.core.persistence.SemaphoresImpl;
import org.sonar.core.resource.DefaultResourcePermissions;
import org.sonar.core.rule.CacheRuleFinder;
@@ -104,6 +105,7 @@ public class TaskContainer extends Container {
container.addSingleton(CacheMetricFinder.class);
container.addSingleton(DefaultUserFinder.class);
container.addSingleton(ResourceTypes.class);
+ container.addSingleton(SemaphoreUpdater.class);
container.addSingleton(SemaphoresImpl.class);
container.addSingleton(PastSnapshotFinderByDate.class);
container.addSingleton(PastSnapshotFinderByDays.class);