|
3 | 3 | import com.wugui.datatx.core.biz.ExecutorBiz;
|
4 | 4 | import com.wugui.datatx.core.biz.model.LogResult;
|
5 | 5 | import com.wugui.datatx.core.biz.model.ReturnT;
|
| 6 | +import com.wugui.datatx.core.glue.GlueTypeEnum; |
6 | 7 | import com.wugui.datatx.core.util.DateUtil;
|
7 | 8 | import com.wugui.datax.admin.core.kill.KillJob;
|
8 | 9 | import com.wugui.datax.admin.core.scheduler.JobScheduler;
|
@@ -94,7 +95,7 @@ public ReturnT<LogResult> logDetailCat(String executorAddress, long triggerTime,
|
94 | 95 |
|
95 | 96 | @RequestMapping(value = "/logKill", method = RequestMethod.POST)
|
96 | 97 | @ApiOperation("kill任务")
|
97 |
| - public ReturnT<String> logKill(int id) { |
| 98 | + public ReturnT<String> logKill(long id) { |
98 | 99 | // base check
|
99 | 100 | JobLog log = jobLogMapper.load(id);
|
100 | 101 | JobInfo jobInfo = jobInfoMapper.loadById(log.getJobId());
|
@@ -168,6 +169,11 @@ public ReturnT<String> clearLog(int jobGroup, int jobId, int type) {
|
168 | 169 | @ApiOperation("停止该job作业")
|
169 | 170 | @PostMapping("/killJob")
|
170 | 171 | public ReturnT<String> killJob(@RequestBody JobLog log) {
|
171 |
| - return KillJob.trigger(log.getId(), log.getTriggerTime(), log.getExecutorAddress(), log.getProcessId()); |
| 172 | + JobInfo jobInfo = jobInfoMapper.loadById(log.getJobId()); |
| 173 | + if (GlueTypeEnum.match(jobInfo.getGlueType()) == GlueTypeEnum.DATAX) { |
| 174 | + return KillJob.trigger(log.getId(), log.getTriggerTime(), log.getExecutorAddress(), log.getProcessId()); |
| 175 | + } else { |
| 176 | + return this.logKill(log.getId()); |
| 177 | + } |
172 | 178 | }
|
173 | 179 | }
|
0 commit comments