yangyichao-mango commented on a change in pull request #3427:
URL: 
https://github.com/apache/incubator-dolphinscheduler/pull/3427#discussion_r467915703



##########
File path: 
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/runner/TaskExecuteThread.java
##########
@@ -256,4 +272,60 @@ private void downloadResource(String execLocalPath,
             }
         }
     }
+
+    /**
+     * delay execution if needed
+     */
+    private void delayExecutionIfNeeded() {
+        long remainTime = 
DateUtils.getRemainTime(taskExecutionContext.getFirstSubmitTime(),
+                taskExecutionContext.getDelayTime() * 60L);
+        logger.info("delay execution time: {} s", remainTime < 0 ? 0 : 
remainTime);
+        if (remainTime > 0) {
+            try {
+                Thread.sleep(remainTime * Constants.SLEEP_TIME_MILLIS);
+            } catch (Exception e) {
+                logger.error("exception", e);
+                logger.error("delay task execution failure, the task will be 
executed directly." +

Review comment:
       ```suggestion
                   logger.error("exception", e);
                   logger.error("delay task execution failure, the task will be 
executed directly." +
   ```
   Hi,
   It will be better to combine these error log to one error log.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to