Browse Source

cherry-pick Fix sql task will send alert if we don't choose the send email

#12984
3.1.2-release
Wenjun Ruan 2 years ago committed by zhuangchong
parent
commit
00cb3f85ec
  1. 2
      dolphinscheduler-task-plugin/dolphinscheduler-task-sql/src/main/java/org/apache/dolphinscheduler/plugin/task/sql/SqlTask.java

2
dolphinscheduler-task-plugin/dolphinscheduler-task-sql/src/main/java/org/apache/dolphinscheduler/plugin/task/sql/SqlTask.java

@ -274,7 +274,7 @@ public class SqlTask extends AbstractTask {
} }
} }
String result = JSONUtils.toJsonString(resultJSONArray); String result = JSONUtils.toJsonString(resultJSONArray);
if (sqlParameters.getSendEmail() == null || sqlParameters.getSendEmail()) { if (Boolean.TRUE.equals(sqlParameters.getSendEmail())) {
sendAttachment(sqlParameters.getGroupId(), StringUtils.isNotEmpty(sqlParameters.getTitle()) sendAttachment(sqlParameters.getGroupId(), StringUtils.isNotEmpty(sqlParameters.getTitle())
? sqlParameters.getTitle() ? sqlParameters.getTitle()
: taskExecutionContext.getTaskName() + " query result sets", result); : taskExecutionContext.getTaskName() + " query result sets", result);

Loading…
Cancel
Save