use of com.vip.saturn.job.reg.exception.RegException in project Saturn by vipshop.
the class ExecutionService method updateErrorJobReturnIfPossible.
private void updateErrorJobReturnIfPossible(JobExecutionMultipleShardingContext jobExecutionShardingContext, int item) {
if (jobExecutionShardingContext instanceof SaturnExecutionContext) {
// 为了展现分片处理失败的状态
SaturnExecutionContext saturnContext = (SaturnExecutionContext) jobExecutionShardingContext;
if (!saturnContext.isSaturnJob()) {
return;
}
SaturnJobReturn jobRet = saturnContext.getShardingItemResults().get(item);
try {
if (jobRet != null) {
int errorGroup = jobRet.getErrorGroup();
if (errorGroup == SaturnSystemErrorGroup.TIMEOUT) {
getJobNodeStorage().createJobNodeIfNeeded(ExecutionNode.getTimeoutNode(item));
} else if (errorGroup != SaturnSystemErrorGroup.SUCCESS) {
getJobNodeStorage().createJobNodeIfNeeded(ExecutionNode.getFailedNode(item));
}
} else {
getJobNodeStorage().createJobNodeIfNeeded(ExecutionNode.getFailedNode(item));
}
} catch (RegException e) {
LogUtils.warn(log, jobName, "update job return fail.", e);
}
}
}
Aggregations