From da48c008d6231fa90cef3accc5906f66c956c5ad Mon Sep 17 00:00:00 2001 From: Julien HENRY Date: Tue, 3 Sep 2013 18:49:34 +0200 Subject: [PATCH] SONAR-4602 Disable dryRun cache until problems are fixed --- .../core/persistence/DryRunDatabaseFactory.java | 11 ++++++----- .../server/platform/DryRunCacheListener.java | 15 +++++++-------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/sonar-core/src/main/java/org/sonar/core/persistence/DryRunDatabaseFactory.java b/sonar-core/src/main/java/org/sonar/core/persistence/DryRunDatabaseFactory.java index 979d956f482..74a4946db93 100644 --- a/sonar-core/src/main/java/org/sonar/core/persistence/DryRunDatabaseFactory.java +++ b/sonar-core/src/main/java/org/sonar/core/persistence/DryRunDatabaseFactory.java @@ -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); } diff --git a/sonar-server/src/main/java/org/sonar/server/platform/DryRunCacheListener.java b/sonar-server/src/main/java/org/sonar/server/platform/DryRunCacheListener.java index 75494aeaab9..e08df859805 100644 --- a/sonar-server/src/main/java/org/sonar/server/platform/DryRunCacheListener.java +++ b/sonar-server/src/main/java/org/sonar/server/platform/DryRunCacheListener.java @@ -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())); + // } } } -- 2.39.5