X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.structural.synchronization.client%2Fsrc%2Forg%2Fsimantics%2Fstructural%2Fsynchronization%2FSynchronizer.java;h=d2738d84444fab9c02739555a676f1bf156d26ee;hp=7412c6ccfc3b0951533e3447fa25e0453f9a8bac;hb=e87f096;hpb=2a46c55805427cfb40ed0db7e33208bb5ffb3d7a diff --git a/bundles/org.simantics.structural.synchronization.client/src/org/simantics/structural/synchronization/Synchronizer.java b/bundles/org.simantics.structural.synchronization.client/src/org/simantics/structural/synchronization/Synchronizer.java index 7412c6ccf..d2738d844 100644 --- a/bundles/org.simantics.structural.synchronization.client/src/org/simantics/structural/synchronization/Synchronizer.java +++ b/bundles/org.simantics.structural.synchronization.client/src/org/simantics/structural/synchronization/Synchronizer.java @@ -12,6 +12,7 @@ import org.eclipse.core.runtime.IProgressMonitor; import org.simantics.db.ReadGraph; import org.simantics.db.Resource; import org.simantics.db.common.procedure.adapter.TransientCacheAsyncListener; +import org.simantics.db.exception.CancelTransactionException; import org.simantics.db.exception.DatabaseException; import org.simantics.db.layer0.exception.MissingVariableValueException; import org.simantics.db.layer0.request.ResourceToPossibleVariable; @@ -228,7 +229,7 @@ public class Synchronizer { } if(changeFlags == null) { - // Full synchronization, synchronize all childre + // Full synchronization, synchronize all children if(children.size() > 0) { double proportionOfWorkForChildren = proportionOfWork / children.size(); for(Variable child : children) @@ -236,6 +237,9 @@ public class Synchronizer { } else { didWork(proportionOfWork); + // Full synchronization is cancelable + if(monitor != null && monitor.isCanceled()) + throw new CancelTransactionException(); } } else {