You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by ki...@apache.org on 2021/12/03 10:16:48 UTC

[dolphinscheduler] branch 2.0.1-prepare updated: [Fix-7070][UI] Remedy the issue with no saving the timeout's strategy into the database. (#7107) (#7150)

This is an automated email from the ASF dual-hosted git repository.

kirs pushed a commit to branch 2.0.1-prepare
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git


The following commit(s) were added to refs/heads/2.0.1-prepare by this push:
     new 659d2bb  [Fix-7070][UI] Remedy the issue with no saving the timeout's strategy into the database. (#7107) (#7150)
659d2bb is described below

commit 659d2bb4b3e49cf040afc3616e49fa597cde964b
Author: wind <ca...@users.noreply.github.com>
AuthorDate: Fri Dec 3 18:16:39 2021 +0800

    [Fix-7070][UI] Remedy the issue with no saving the timeout's strategy into the database. (#7107) (#7150)
    
    Co-authored-by: Hua Jiang <ji...@163.com>
---
 .../dao/entity/TaskDefinition.java                 |  2 ++
 .../dag/_source/formModel/_source/timeoutAlarm.vue | 24 +++++++++++++++++-----
 2 files changed, 21 insertions(+), 5 deletions(-)

diff --git a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/TaskDefinition.java b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/TaskDefinition.java
index 7da11a6..8c47fbf 100644
--- a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/TaskDefinition.java
+++ b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/TaskDefinition.java
@@ -31,6 +31,7 @@ import java.util.Map;
 import java.util.Objects;
 import java.util.stream.Collectors;
 
+import com.baomidou.mybatisplus.annotation.FieldStrategy;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
@@ -157,6 +158,7 @@ public class TaskDefinition {
     /**
      * timeout notify strategy
      */
+    @TableField(updateStrategy = FieldStrategy.IGNORED)
     private TaskTimeoutStrategy timeoutNotifyStrategy;
 
     /**
diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/_source/timeoutAlarm.vue b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/_source/timeoutAlarm.vue
index 2fece25..18b7314 100644
--- a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/_source/timeoutAlarm.vue
+++ b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/_source/timeoutAlarm.vue
@@ -60,7 +60,11 @@
 <script>
   import _ from 'lodash'
   import disabledState from '@/module/mixin/disabledState'
-
+  const StrategyMap = {
+    WARN: 'WARN',
+    FAILED: 'FAILED',
+    WARNFAILED: 'WARNFAILED'
+  }
   export default {
     name: 'form-timeout-alarm',
     data () {
@@ -100,10 +104,12 @@
           strategy: (() => {
             // Handling checkout sequence
             let strategy = this.strategy
-            if (strategy.length === 2 && strategy[0] === 'FAILED') {
-              return [strategy[1], strategy[0]].join(',')
+            if (strategy.length > 1) {
+              return StrategyMap.WARNFAILED
+            } else if (strategy.length === 1) {
+              return strategy[0]
             } else {
-              return strategy.join(',')
+              return ''
             }
           })(),
           interval: parseInt(this.interval),
@@ -119,7 +125,15 @@
       // Non-null objects represent backfill
       if (!_.isEmpty(o) && o.timeout) {
         this.enable = o.timeout.enable || false
-        this.strategy = _.split(o.timeout.strategy, ',') || ['WARN']
+        if (o.timeout.strategy) {
+          if (o.timeout.strategy === StrategyMap.WARNFAILED) {
+            this.strategy = [StrategyMap.WARN, StrategyMap.FAILED]
+          } else {
+            this.strategy = [o.timeout.strategy]
+          }
+        } else {
+          this.strategy = [StrategyMap.WARN]
+        }
         this.interval = o.timeout.interval || null
       }
     },