vcs: Always invoke "continuation" for "BackgroundTaskGroup"

Otherwise "QueueProcessor.waitFor()" (and therefore
"BackgroundTaskQueue.waitForTasksToFinish()") will never finish in case
of error/cancellation as "QueueProcessor.isProcessing" flag is set to
"false" only when running "continuation"
This commit is contained in:
Konstantin Kolosovsky
2016-11-09 23:53:59 +03:00
parent 3136960716
commit 296f512f4d
@@ -68,11 +68,6 @@ public class BackgroundTaskGroup extends BackgroundTaskQueue {
}
}
@Override
public void onSuccess() {
continuation.run();
}
@Override
public void onCancel() {
end();
@@ -83,6 +78,11 @@ public class BackgroundTaskGroup extends BackgroundTaskQueue {
LOG.error(e);
end();
}
@Override
public void onFinished() {
continuation.run();
}
}.queue());
}
@@ -98,12 +98,10 @@ public class BackgroundTaskGroup extends BackgroundTaskQueue {
isSuccess = e.isWarning();
}
finally {
if (isSuccess) {
continuation.run();
}
else {
if (!isSuccess) {
end();
}
continuation.run();
}
});
}