]> source.dussan.org Git - sonarqube.git/commitdiff
Do not keep DSM measure in cache
authorsimonbrandhof <simon.brandhof@gmail.com>
Wed, 15 Dec 2010 06:51:30 +0000 (06:51 +0000)
committersimonbrandhof <simon.brandhof@gmail.com>
Wed, 15 Dec 2010 06:51:30 +0000 (06:51 +0000)
plugins/sonar-design-plugin/src/main/java/org/sonar/plugins/design/batch/ProjectDsmDecorator.java

index 0f040a975a41052040bbc32b39becedbde4fcd71..103c0b95fc563350630a5ef867a9639546bb2008 100644 (file)
@@ -25,6 +25,7 @@ import org.sonar.api.batch.DecoratorContext;
 import org.sonar.api.batch.SonarIndex;
 import org.sonar.api.measures.CoreMetrics;
 import org.sonar.api.measures.Measure;
+import org.sonar.api.measures.PersistenceMode;
 import org.sonar.api.resources.Project;
 import org.sonar.api.resources.Resource;
 import org.sonar.api.resources.ResourceUtils;
@@ -63,7 +64,9 @@ public class ProjectDsmDecorator implements Decorator {
   }
 
   private void saveDsm(DecoratorContext context, Dsm<Resource> dsm) {
-    context.saveMeasure(new Measure(CoreMetrics.DEPENDENCY_MATRIX, DsmSerializer.serialize(dsm)));
+    Measure measure = new Measure(CoreMetrics.DEPENDENCY_MATRIX, DsmSerializer.serialize(dsm));
+    measure.setPersistenceMode(PersistenceMode.DATABASE);
+    context.saveMeasure(measure);
   }
 
   private Dsm<Resource> getDsm(Collection<Resource> subProjects) {