REQ-3104: 异常处理
This commit is contained in:
parent
10c609f514
commit
840aa754cd
@ -43,8 +43,7 @@ public class BatchController {
|
||||
try {
|
||||
task.run();
|
||||
} catch (Exception e) {
|
||||
warn("operation failed", e);
|
||||
error.compareAndSet(null, e);
|
||||
setOperationFailed(e);
|
||||
}
|
||||
};
|
||||
submitCount++;
|
||||
@ -54,7 +53,16 @@ public class BatchController {
|
||||
return;
|
||||
}
|
||||
info(String.format("using async because of parallelismThreshold > %d", parallelismThreshold));
|
||||
try {
|
||||
asyncTasks.runAsync(runner);
|
||||
} catch (Exception e) {
|
||||
setOperationFailed(e);
|
||||
}
|
||||
}
|
||||
|
||||
private void setOperationFailed(Exception e) {
|
||||
warn("operation failed", e);
|
||||
error.compareAndSet(null, e);
|
||||
}
|
||||
|
||||
public void awaitTermination(long timeout, TimeUnit unit) throws Exception {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user