Skip to content

Commit

Permalink
[Fix][Admin] Fix the problem of duplicate Jid, which leads to retriev…
Browse files Browse the repository at this point in the history
…ing multiple job instances (DataLinkDC#3386)

Co-authored-by: luoshangjie <luoshangjie@yfpharmacy.com>
  • Loading branch information
18216499322 and luoshangjie authored Apr 12, 2024
1 parent 662c0d4 commit d5e81c0
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,11 @@ public JobInfoDetail refreshJobInfoDetail(Integer jobInstanceId, boolean isForce
@Override
public boolean hookJobDone(String jobId, Integer taskId) {
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);
if (instance == null) {
// Not having a corresponding jobinstance means that this may not have succeeded in running,
Expand Down

0 comments on commit d5e81c0

Please sign in to comment.