minor
authorKatja Luther <k.luther@bgbm.org>
Thu, 24 May 2018 18:54:51 +0000 (20:54 +0200)
committerKatja Luther <k.luther@bgbm.org>
Thu, 24 May 2018 18:54:51 +0000 (20:54 +0200)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/util/ProgressMonitorClientManager.java

index bfc66e1bce43db36ddc1b7c9fc4b1f7ee87c3749..e5d09c73feefcc7af9e3d29af60fd6302555bc64 100644 (file)
@@ -87,7 +87,7 @@ public class ProgressMonitorClientManager {
             // wait about 10 seconds for the remoting monitor to be initialised
             // (i.e. for the begin task method to be called ON THE REMOTING MONITOR)
             for(int i=0;i<START_DELAY;i++) {
-                Thread.sleep(1000);
+                Thread.sleep(500);
                 logger.info("Waiting for monitered work to start ..");
                 remotingMonitor = progressMonitorService.getRemotingMonitor(uuid);
                 if(remotingMonitor.getTotalWork() > 0) {
@@ -100,7 +100,14 @@ public class ProgressMonitorClientManager {
                 return remotingMonitor;
 //                throw new InterruptedException("Monitor has zero work units");
             }else if (remotingMonitor.getTotalWork() == 0 ){
-                throw new InterruptedException("Monitor has zero work units");
+                Object result = remotingMonitor.getResult();
+                InterruptedException exception = new InterruptedException("Monitor has zero work units");
+                if (result instanceof UpdateResult){
+                    ((UpdateResult)result).addException(exception);
+                }else if (result == null){
+                    result = new UpdateResult();
+                }
+
             }
             // start the client monitor
             monitor.beginTask(label, remotingMonitor.getTotalWork());
@@ -127,7 +134,7 @@ public class ProgressMonitorClientManager {
                             if (result instanceof UpdateResult){
                                 ((UpdateResult)result).addException(exception);
                             }
-
+                            return remotingMonitor;
                         }
                         feedbackGenerators.get(feedbackCount).setFeedbackForMonitor(uuid);
                         feedbackCount++;