]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.acorn/src/org/simantics/acorn/ClusterManager.java
Save cluster sets only when creating DB snapshots
[simantics/platform.git] / bundles / org.simantics.acorn / src / org / simantics / acorn / ClusterManager.java
index b2a30953cca9e0bff26e72dc69a788139e52a817..3cbb64977ae203d3f55efa879e8ec56331477be6 100644 (file)
@@ -143,7 +143,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;
                }
@@ -163,14 +163,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);
                
                System.err.println(" -finished: amount of files is " + amountOfFiles);