Browse Source

fix switchVersion error (#6783) (#6784)

Co-authored-by: honghuo.zw <honghuo.zw@alibaba-inc.com>
Co-authored-by: Kirs <acm_master@163.com>
3.0.0/version-upgrade
zwZjut 3 years ago committed by GitHub
parent
commit
94352a4f5f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java

9
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java

@ -282,10 +282,11 @@ public class TaskDefinitionServiceImpl extends BaseServiceImpl implements TaskDe
putMsg(result, Status.TASK_DEFINE_NOT_EXIST, taskCode); putMsg(result, Status.TASK_DEFINE_NOT_EXIST, taskCode);
return result; return result;
} }
TaskDefinitionLog taskDefinitionLog = taskDefinitionLogMapper.queryByDefinitionCodeAndVersion(taskCode, version); TaskDefinitionLog taskDefinitionUpdate = taskDefinitionLogMapper.queryByDefinitionCodeAndVersion(taskCode, version);
taskDefinitionLog.setUserId(loginUser.getId()); taskDefinitionUpdate.setUserId(loginUser.getId());
taskDefinitionLog.setUpdateTime(new Date()); taskDefinitionUpdate.setUpdateTime(new Date());
int switchVersion = taskDefinitionMapper.updateById(taskDefinitionLog); taskDefinitionUpdate.setId(taskDefinition.getId());
int switchVersion = taskDefinitionMapper.updateById(taskDefinitionUpdate);
if (switchVersion > 0) { if (switchVersion > 0) {
result.put(Constants.DATA_LIST, taskCode); result.put(Constants.DATA_LIST, taskCode);
putMsg(result, Status.SUCCESS); putMsg(result, Status.SUCCESS);

Loading…
Cancel
Save