]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-4602 Disable dryRun cache until problems are fixed
authorJulien HENRY <julien.henry@sonarsource.com>
Tue, 3 Sep 2013 16:49:34 +0000 (18:49 +0200)
committerJulien HENRY <julien.henry@sonarsource.com>
Tue, 3 Sep 2013 16:49:34 +0000 (18:49 +0200)
sonar-core/src/main/java/org/sonar/core/persistence/DryRunDatabaseFactory.java
sonar-server/src/main/java/org/sonar/server/platform/DryRunCacheListener.java

index 979d956f4824157a6a7b591c8c739763806a923e..74a4946db9332daefa3148bad2548862f18f84d1 100644 (file)
@@ -124,11 +124,12 @@ public class DryRunDatabaseFactory implements ServerComponent {
     long startup = System.currentTimeMillis();
 
     Long lastTimestampInCache = getLastTimestampInCache(projectId);
-    if (lastTimestampInCache == null || !isValid(projectId, lastTimestampInCache)) {
-      lastTimestampInCache = System.nanoTime();
-      cleanCache(projectId);
-      createNewDatabaseForDryRun(projectId, startup, lastTimestampInCache);
-    }
+    // TODO Temporary disable cache until cache eviction is ok
+    // if (lastTimestampInCache == null || !isValid(projectId, lastTimestampInCache)) {
+    lastTimestampInCache = System.nanoTime();
+    cleanCache(projectId);
+    createNewDatabaseForDryRun(projectId, startup, lastTimestampInCache);
+    // }
     return dbFileContent(projectId, lastTimestampInCache);
   }
 
index 75494aeaab9730660bce90eb62ef9b573577cb35..e08df8598051b5fbd9e0dee4e544a8023b4f72e0 100644 (file)
@@ -20,9 +20,7 @@
 package org.sonar.server.platform;
 
 import org.sonar.api.config.SettingsChangeHandler;
-import org.sonar.core.persistence.DryRunDatabaseFactory;
 import org.sonar.core.resource.ResourceDao;
-import org.sonar.core.resource.ResourceDto;
 
 public class DryRunCacheListener implements SettingsChangeHandler {
 
@@ -36,11 +34,12 @@ public class DryRunCacheListener implements SettingsChangeHandler {
 
   @Override
   public void onChange(SettingsChange change) {
-    if (change.isGlobal()) {
-      settings.saveProperty(DryRunDatabaseFactory.SONAR_DRY_RUN_CACHE_LAST_UPDATE_KEY, String.valueOf(System.nanoTime()));
-    } else if (change.componentKey() != null) {
-      ResourceDto rootProject = resourceDao.getRootProjectByComponentKey(change.componentKey());
-      settings.saveProperty(DryRunDatabaseFactory.getCacheLastUpdateKey(rootProject.getId()), String.valueOf(System.nanoTime()));
-    }
+    // TODO Temporary disable cache eviction
+    // if (change.isGlobal()) {
+    // settings.saveProperty(DryRunDatabaseFactory.SONAR_DRY_RUN_CACHE_LAST_UPDATE_KEY, String.valueOf(System.nanoTime()));
+    // } else if (change.componentKey() != null) {
+    // ResourceDto rootProject = resourceDao.getRootProjectByComponentKey(change.componentKey());
+    // settings.saveProperty(DryRunDatabaseFactory.getCacheLastUpdateKey(rootProject.getId()), String.valueOf(System.nanoTime()));
+    // }
   }
 }