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"
}
}
- @Override
- public void onSuccess() {
- continuation.run();
- }
-
@Override
public void onCancel() {
end();
LOG.error(e);
end();
}
+
+ @Override
+ public void onFinished() {
+ continuation.run();
+ }
}.queue());
}
isSuccess = e.isWarning();
}
finally {
- if (isSuccess) {
- continuation.run();
- }
- else {
+ if (!isSuccess) {
end();
}
+ continuation.run();
}
});
}