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

chufenggao 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 d675d32771 Fix confusing constant string for unit convertor (#15126)
d675d32771 is described below

commit d675d32771f89a0ad09470e247469b504c6666fe
Author: Eric Gao <[email protected]>
AuthorDate: Mon Nov 6 21:32:36 2023 +0800

    Fix confusing constant string for unit convertor (#15126)
---
 .../java/org/apache/dolphinscheduler/common/constants/Constants.java  | 4 ++--
 .../java/org/apache/dolphinscheduler/dao/entity/TaskInstance.java     | 4 ++--
 .../server/master/builder/TaskExecutionContextBuilder.java            | 4 ++--
 .../server/master/runner/StateWheelExecuteThread.java                 | 4 ++--
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git 
a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/constants/Constants.java
 
b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/constants/Constants.java
index 8ea3686f3d..94577d6bbf 100644
--- 
a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/constants/Constants.java
+++ 
b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/constants/Constants.java
@@ -306,9 +306,9 @@ public final class Constants {
     public static final int DEFAULT_WORKER_HOST_WEIGHT = 100;
 
     /**
-     * time unit second to minutes
+     * unit convertor for minute to second
      */
-    public static final int SEC_2_MINUTES_TIME_UNIT = 60;
+    public static final int MINUTE_2_SECOND_TIME_UNIT = 60;
 
     /***
      *
diff --git 
a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/TaskInstance.java
 
b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/TaskInstance.java
index b71a229ff5..b205aa8ac7 100644
--- 
a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/TaskInstance.java
+++ 
b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/TaskInstance.java
@@ -17,7 +17,7 @@
 
 package org.apache.dolphinscheduler.dao.entity;
 
-import static 
org.apache.dolphinscheduler.common.constants.Constants.SEC_2_MINUTES_TIME_UNIT;
+import static 
org.apache.dolphinscheduler.common.constants.Constants.MINUTE_2_SECOND_TIME_UNIT;
 import static 
org.apache.dolphinscheduler.plugin.task.api.TaskConstants.TASK_TYPE_BLOCKING;
 import static 
org.apache.dolphinscheduler.plugin.task.api.TaskConstants.TASK_TYPE_CONDITIONS;
 import static 
org.apache.dolphinscheduler.plugin.task.api.TaskConstants.TASK_TYPE_DEPENDENT;
@@ -410,7 +410,7 @@ public class TaskInstance implements Serializable {
         Date now = new Date();
         long failedTimeInterval = DateUtils.differSec(now, getEndTime());
         // task retry does not over time, return false
-        return getRetryInterval() * SEC_2_MINUTES_TIME_UNIT < 
failedTimeInterval;
+        return getRetryInterval() * MINUTE_2_SECOND_TIME_UNIT < 
failedTimeInterval;
     }
 
 }
diff --git 
a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/builder/TaskExecutionContextBuilder.java
 
b/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/builder/TaskExecutionContextBuilder.java
index 9090130eff..e4e69043e6 100644
--- 
a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/builder/TaskExecutionContextBuilder.java
+++ 
b/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/builder/TaskExecutionContextBuilder.java
@@ -18,7 +18,7 @@
 package org.apache.dolphinscheduler.server.master.builder;
 
 import static com.google.common.base.Preconditions.checkNotNull;
-import static 
org.apache.dolphinscheduler.common.constants.Constants.SEC_2_MINUTES_TIME_UNIT;
+import static 
org.apache.dolphinscheduler.common.constants.Constants.MINUTE_2_SECOND_TIME_UNIT;
 
 import org.apache.dolphinscheduler.common.enums.TimeoutFlag;
 import org.apache.dolphinscheduler.common.utils.DateUtils;
@@ -86,7 +86,7 @@ public class TaskExecutionContextBuilder {
             if (taskDefinition.getTimeoutNotifyStrategy() == 
TaskTimeoutStrategy.FAILED
                     || taskDefinition.getTimeoutNotifyStrategy() == 
TaskTimeoutStrategy.WARNFAILED) {
                 taskExecutionContext.setTaskTimeout(
-                        Math.min(taskDefinition.getTimeout() * 
SEC_2_MINUTES_TIME_UNIT, Integer.MAX_VALUE));
+                        Math.min(taskDefinition.getTimeout() * 
MINUTE_2_SECOND_TIME_UNIT, Integer.MAX_VALUE));
             }
         }
         taskExecutionContext.setTaskParams(taskDefinition.getTaskParams());
diff --git 
a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/StateWheelExecuteThread.java
 
b/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/StateWheelExecuteThread.java
index 38086a8b46..d0e48b14c1 100644
--- 
a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/StateWheelExecuteThread.java
+++ 
b/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/StateWheelExecuteThread.java
@@ -148,7 +148,7 @@ public class StateWheelExecuteThread extends 
BaseDaemonThread {
                 }
                 long timeRemain = 
DateUtils.getRemainTime(processInstance.getStartTime(),
                         (long) processInstance.getTimeout()
-                                * Constants.SEC_2_MINUTES_TIME_UNIT);
+                                * Constants.MINUTE_2_SECOND_TIME_UNIT);
                 if (timeRemain < 0) {
                     log.info("Workflow instance {} timeout, adding timeout 
event", processInstance.getId());
                     addProcessTimeoutEvent(processInstance);
@@ -248,7 +248,7 @@ public class StateWheelExecuteThread extends 
BaseDaemonThread {
                 if (TimeoutFlag.OPEN == 
taskInstance.getTaskDefine().getTimeoutFlag()) {
                     long timeRemain = 
DateUtils.getRemainTime(taskInstance.getStartTime(),
                             (long) taskInstance.getTaskDefine().getTimeout()
-                                    * Constants.SEC_2_MINUTES_TIME_UNIT);
+                                    * Constants.MINUTE_2_SECOND_TIME_UNIT);
                     if (timeRemain < 0) {
                         log.info("Task instance is timeout, adding task 
timeout event and remove the check");
                         addTaskTimeoutEvent(taskInstance);

Reply via email to