You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by ji...@apache.org on 2021/11/16 02:17:02 UTC
[dolphinscheduler] branch dev updated: fix switchVersion error (#6783) (#6784)
This is an automated email from the ASF dual-hosted git repository.
jinyleechina pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git
The following commit(s) were added to refs/heads/dev by this push:
new 94352a4 fix switchVersion error (#6783) (#6784)
94352a4 is described below
commit 94352a4f5f44a167f99c7e115cb1e69647724079
Author: zwZjut <zw...@163.com>
AuthorDate: Tue Nov 16 10:16:52 2021 +0800
fix switchVersion error (#6783) (#6784)
Co-authored-by: honghuo.zw <ho...@alibaba-inc.com>
Co-authored-by: Kirs <ac...@163.com>
---
.../api/service/impl/TaskDefinitionServiceImpl.java | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
index deed94f..e203b9b 100644
--- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
+++ b/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);
return result;
}
- TaskDefinitionLog taskDefinitionLog = taskDefinitionLogMapper.queryByDefinitionCodeAndVersion(taskCode, version);
- taskDefinitionLog.setUserId(loginUser.getId());
- taskDefinitionLog.setUpdateTime(new Date());
- int switchVersion = taskDefinitionMapper.updateById(taskDefinitionLog);
+ TaskDefinitionLog taskDefinitionUpdate = taskDefinitionLogMapper.queryByDefinitionCodeAndVersion(taskCode, version);
+ taskDefinitionUpdate.setUserId(loginUser.getId());
+ taskDefinitionUpdate.setUpdateTime(new Date());
+ taskDefinitionUpdate.setId(taskDefinition.getId());
+ int switchVersion = taskDefinitionMapper.updateById(taskDefinitionUpdate);
if (switchVersion > 0) {
result.put(Constants.DATA_LIST, taskCode);
putMsg(result, Status.SUCCESS);