Unverified Commit d5e81c0d authored by luoshangjie's avatar luoshangjie Committed by GitHub

[Fix][Admin] Fix the problem of duplicate Jid, which leads to retrieving…

[Fix][Admin] Fix the problem of duplicate Jid, which leads to retrieving multiple job instances (#3386) Co-authored-by: 's avatarluoshangjie <luoshangjie@yfpharmacy.com>
parent 662c0d46
...@@ -220,7 +220,11 @@ public class JobInstanceServiceImpl extends SuperServiceImpl<JobInstanceMapper, ...@@ -220,7 +220,11 @@ public class JobInstanceServiceImpl extends SuperServiceImpl<JobInstanceMapper,
@Override @Override
public boolean hookJobDone(String jobId, Integer taskId) { public boolean hookJobDone(String jobId, Integer taskId) {
LambdaQueryWrapper<JobInstance> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<JobInstance> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(JobInstance::getJid, jobId).eq(JobInstance::getTaskId, taskId); queryWrapper
.eq(JobInstance::getJid, jobId)
.eq(JobInstance::getTaskId, taskId)
.orderByDesc(JobInstance::getCreateTime)
.last("limit 1");
JobInstance instance = baseMapper.selectOne(queryWrapper); JobInstance instance = baseMapper.selectOne(queryWrapper);
if (instance == null) { if (instance == null) {
// Not having a corresponding jobinstance means that this may not have succeeded in running, // Not having a corresponding jobinstance means that this may not have succeeded in running,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment