You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by li...@apache.org on 2020/06/19 06:50:22 UTC

[incubator-dolphinscheduler] branch dev updated: always send emails no matter there are results (#3015)

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

lidongdai pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-dolphinscheduler.git


The following commit(s) were added to refs/heads/dev by this push:
     new a65cb48  always send emails no matter there are results (#3015)
a65cb48 is described below

commit a65cb48191b81faea7c200f989ce5ff181d5aee1
Author: gabry.wu <ga...@apache.org>
AuthorDate: Fri Jun 19 14:50:10 2020 +0800

    always send emails no matter there are results (#3015)
    
    * always send emails no matter there are results
    
    * always send emails no matter there are results
---
 .../dolphinscheduler/server/worker/task/sql/SqlTask.java    | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/sql/SqlTask.java b/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/sql/SqlTask.java
index d201a1f..4781143 100644
--- a/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/sql/SqlTask.java
+++ b/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/sql/SqlTask.java
@@ -270,16 +270,9 @@ public class SqlTask extends AbstractTask {
         String result = JSONUtils.toJsonString(resultJSONArray);
         logger.debug("execute sql : {}", result);
 
-        // if there is a result set
-        if (!resultJSONArray.isEmpty(null) ) {
-            if (StringUtils.isNotEmpty(sqlParameters.getTitle())) {
-                sendAttachment(sqlParameters.getTitle(),
-                        JSONUtils.toJsonString(resultJSONArray));
-            }else{
-                sendAttachment(taskExecutionContext.getTaskName() + " query resultsets ",
-                        JSONUtils.toJsonString(resultJSONArray));
-            }
-        }
+        sendAttachment(StringUtils.isNotEmpty(sqlParameters.getTitle()) ?
+                        sqlParameters.getTitle(): taskExecutionContext.getTaskName() + " query result sets",
+                JSONUtils.toJsonString(resultJSONArray));
     }
 
     /**