]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.acorn/src/org/simantics/acorn/ClusterManager.java
Merge "Save cluster sets only when creating DB snapshots"
[simantics/platform.git] / bundles / org.simantics.acorn / src / org / simantics / acorn / ClusterManager.java
index c414dd2b601a834a1de15d55be218535721b349d..22629d4e64237ab63c6fc89a12f0754087254edb 100644 (file)
@@ -147,7 +147,7 @@ public class ClusterManager {
                // Cluster files are always there 
                // Nothing has been written => no need to do anything
                long amountOfFiles = countFiles(workingDirectory);
-               if(!fullSave && amountOfFiles < 3) {
+               if(!fullSave && amountOfFiles == 0) {
     //             System.err.println("amountOfFiles < 3");
                    return false;
                }
@@ -167,14 +167,14 @@ public class ClusterManager {
                if (!safeToMakeSnapshot.get())
                    throw cause;
                
+               ClusterSetsSupport cssi = locator.getService(ClusterSetsSupport.class); 
+               cssi.save();
+
                persistHeadState();
-               
+
                if (fullSave)
                    mainState.save(dbFolder);
     
-               ClusterSetsSupport cssi = locator.getService(ClusterSetsSupport.class); 
-               cssi.save();
-    
                amountOfFiles = countFiles(workingDirectory);
                
                LOGGER.info(" -finished: amount of files is {}", amountOfFiles);