|
|
@@ -47,24 +47,32 @@ public class XxlJobLogCallbackServerHandler extends AbstractHandler {
|
|
47
|
47
|
if (!ResponseModel.SUCCESS.equals(log.getHandleStatus())) {
|
|
48
|
48
|
XxlJobInfo xxlJobInfo = DynamicSchedulerUtil.xxlJobInfoDao.load(log.getJobGroup(), log.getJobName());
|
|
49
|
49
|
if (xxlJobInfo!=null && StringUtils.isNotBlank(xxlJobInfo.getChildJobKey())) {
|
|
50
|
|
- String[] jobKeyArr = xxlJobInfo.getChildJobKey().split("_");
|
|
51
|
|
- if (jobKeyArr!=null && jobKeyArr.length==2) {
|
|
52
|
|
- XxlJobInfo childJobInfo = DynamicSchedulerUtil.xxlJobInfoDao.load(jobKeyArr[0], jobKeyArr[1]);
|
|
53
|
|
- if (childJobInfo!=null) {
|
|
54
|
|
- try {
|
|
55
|
|
- boolean ret = DynamicSchedulerUtil.triggerJob(childJobInfo.getJobName(), childJobInfo.getJobGroup());
|
|
|
50
|
+ childTriggerMsg = "<hr>";
|
|
|
51
|
+ String[] childJobKeys = xxlJobInfo.getChildJobKey().split(",");
|
|
|
52
|
+ for (int i = 0; i < childJobKeys.length; i++) {
|
|
|
53
|
+ String[] jobKeyArr = childJobKeys[i].split("_");
|
|
|
54
|
+ if (jobKeyArr!=null && jobKeyArr.length==2) {
|
|
|
55
|
+ XxlJobInfo childJobInfo = DynamicSchedulerUtil.xxlJobInfoDao.load(jobKeyArr[0], jobKeyArr[1]);
|
|
|
56
|
+ if (childJobInfo!=null) {
|
|
|
57
|
+ try {
|
|
|
58
|
+ boolean ret = DynamicSchedulerUtil.triggerJob(childJobInfo.getJobName(), childJobInfo.getJobGroup());
|
|
56
|
59
|
|
|
57
|
|
- // add msg
|
|
58
|
|
- childTriggerMsg += MessageFormat.format("<br> 触发子任务成功, 子任务Key: {0}, status: {1}, 子任务描述: {2}", xxlJobInfo.getChildJobKey(), ret, childJobInfo.getJobDesc());
|
|
59
|
|
- } catch (SchedulerException e) {
|
|
60
|
|
- logger.error("", e);
|
|
|
60
|
+ // add msg
|
|
|
61
|
+ childTriggerMsg += MessageFormat.format("<br> {0}/{1} 触发子任务成功, 子任务Key: {2}, status: {3}, 子任务描述: {4}",
|
|
|
62
|
+ (i+1), childJobKeys.length, childJobKeys[i], ret, childJobInfo.getJobDesc());
|
|
|
63
|
+ } catch (SchedulerException e) {
|
|
|
64
|
+ logger.error("", e);
|
|
|
65
|
+ }
|
|
|
66
|
+ } else {
|
|
|
67
|
+ childTriggerMsg += MessageFormat.format("<br> {0}/{1} 触发子任务失败, 子任务xxlJobInfo不存在, 子任务Key: {2}",
|
|
|
68
|
+ (i+1), childJobKeys.length, childJobKeys[i]);
|
|
61
|
69
|
}
|
|
62
|
70
|
} else {
|
|
63
|
|
- childTriggerMsg = "<br> 触发子任务失败, 子任务xxlJobInfo不存在, 子任务Key:" + xxlJobInfo.getChildJobKey();
|
|
64
|
|
- }
|
|
65
|
|
- } else {
|
|
66
|
|
- childTriggerMsg = "<br> 触发子任务失败, 子任务Key格式错误, 子任务Key:" + xxlJobInfo.getChildJobKey();
|
|
67
|
|
- }
|
|
|
71
|
+ childTriggerMsg += MessageFormat.format("<br> {0}/{1} 触发子任务失败, 子任务Key格式错误, 子任务Key: {2}",
|
|
|
72
|
+ (i+1), childJobKeys.length, childJobKeys[i]);
|
|
|
73
|
+ }
|
|
|
74
|
+ }
|
|
|
75
|
+
|
|
68
|
76
|
}
|
|
69
|
77
|
}
|
|
70
|
78
|
|