--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2018 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.sonar.ce.cleaning;
+
+public class NoopCeCleaningSchedulerImpl implements CeCleaningScheduler {
+ @Override
+ public void startScheduling() {
+ // do nothing
+ }
+}
import org.sonar.ce.StandaloneCeDistributedInformation;
import org.sonar.ce.async.SynchronousAsyncExecution;
import org.sonar.ce.cleaning.CeCleaningModule;
+import org.sonar.ce.cleaning.NoopCeCleaningSchedulerImpl;
import org.sonar.ce.db.ReadOnlyPropertiesDao;
import org.sonar.ce.logging.CeProcessLogging;
import org.sonar.ce.monitoring.CEQueueStatusImpl;
import static org.sonar.core.extension.PlatformLevelPredicates.hasPlatformLevel;
import static org.sonar.core.extension.PlatformLevelPredicates.hasPlatformLevel4OrNone;
import static org.sonar.process.ProcessProperties.Property.CLUSTER_ENABLED;
+import static org.sonar.process.ProcessProperties.Property.SONARCLOUD_ENABLED;
public class ComputeEngineContainerImpl implements ComputeEngineContainer {
WebhookModule.class,
QualityGateFinder.class,
- QualityGateEvaluatorImpl.class,
+ QualityGateEvaluatorImpl.class
- // cleaning
- CeCleaningModule.class);
+ );
- if (props.valueAsBoolean(CLUSTER_ENABLED.getKey())) {
+ if (props.valueAsBoolean(SONARCLOUD_ENABLED.getKey())) {
+ // no cleaning job on sonarcloud and no distributed information
+ container.add(
+ NoopCeCleaningSchedulerImpl.class,
+ StandaloneCeDistributedInformation.class,
+ CEQueueStatusImpl.class);
+ } else if (props.valueAsBoolean(CLUSTER_ENABLED.getKey())) {
container.add(
+ CeCleaningModule.class,
+
// system health
CeDistributedInformationImpl.class,
DbSection.class,
ProcessInfoProvider.class,
- DistributedCEQueueStatusImpl.class
-
- );
+ DistributedCEQueueStatusImpl.class);
} else {
container.add(
+ CeCleaningModule.class,
StandaloneCeDistributedInformation.class,
- CEQueueStatusImpl.class
-
- );
+ CEQueueStatusImpl.class);
}
}
private static Object[] startupComponents() {
- return new Object[]{
+ return new Object[] {
ServerLifecycleNotifier.class,
PurgeCeActivities.class,
CeQueueCleaner.class