You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by le...@apache.org on 2022/01/17 02:54:43 UTC
[dolphinscheduler] branch 2.0.3-prepare updated: [Fix-8056] Rectify this issue about failing to edit worker groups for an environment. (#8072) (#8078)
This is an automated email from the ASF dual-hosted git repository.
leonbao pushed a commit to branch 2.0.3-prepare
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git
The following commit(s) were added to refs/heads/2.0.3-prepare by this push:
new 5158f4a [Fix-8056] Rectify this issue about failing to edit worker groups for an environment. (#8072) (#8078)
5158f4a is described below
commit 5158f4a0a91a69a25596c1c58a52b1a9f2ba7a18
Author: wind <ca...@users.noreply.github.com>
AuthorDate: Mon Jan 17 10:52:23 2022 +0800
[Fix-8056] Rectify this issue about failing to edit worker groups for an environment. (#8072) (#8078)
Co-authored-by: calvin <ji...@163.com>
---
.../api/service/impl/EnvironmentServiceImpl.java | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/EnvironmentServiceImpl.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/EnvironmentServiceImpl.java
index ff0eea0..bd502e2 100644
--- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/EnvironmentServiceImpl.java
+++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/EnvironmentServiceImpl.java
@@ -366,17 +366,18 @@ public class EnvironmentServiceImpl extends BaseServiceImpl implements Environme
env.setOperator(loginUser.getId());
env.setUpdateTime(new Date());
- int update = environmentMapper.update(env, new UpdateWrapper<Environment>().lambda().eq(Environment::getCode,code));
+ int update = environmentMapper.update(env, new UpdateWrapper<Environment>().lambda().eq(Environment::getCode, code));
if (update > 0) {
deleteWorkerGroupSet.stream().forEach(key -> {
- if (!StringUtils.isEmpty(key)) {
+ if (StringUtils.isNotEmpty(key)) {
relationMapper.delete(new QueryWrapper<EnvironmentWorkerGroupRelation>()
.lambda()
- .eq(EnvironmentWorkerGroupRelation::getEnvironmentCode,code));
+ .eq(EnvironmentWorkerGroupRelation::getEnvironmentCode, code)
+ .eq(EnvironmentWorkerGroupRelation::getWorkerGroup, key));
}
});
addWorkerGroupSet.stream().forEach(key -> {
- if (!StringUtils.isEmpty(key)) {
+ if (StringUtils.isNotEmpty(key)) {
EnvironmentWorkerGroupRelation relation = new EnvironmentWorkerGroupRelation();
relation.setEnvironmentCode(code);
relation.setWorkerGroup(key);