Browse Source

The SQL task fails if the mail delivery fails

pull/2/head
lgcareer 6 years ago
parent
commit
c768445322
  1. 3
      escheduler-server/src/main/java/cn/escheduler/server/worker/task/sql/SqlTask.java

3
escheduler-server/src/main/java/cn/escheduler/server/worker/task/sql/SqlTask.java

@ -374,8 +374,7 @@ public class SqlTask extends AbstractTask {
String showTypeName = sqlParameters.getShowType().replace(Constants.COMMA,"").trim();
if(EnumUtils.isValidEnum(ShowType.class,showTypeName)){
Map<String, Object> mailResult = MailUtils.sendMails(receviersList, receviersCcList, title, content, ShowType.valueOf(showTypeName));
Status status = (Status) mailResult.get(cn.escheduler.api.utils.Constants.STATUS);
if(status != Status.SUCCESS){
if(!(Boolean) mailResult.get(cn.escheduler.api.utils.Constants.STATUS)){
throw new RuntimeException("send mail failed!");
}
}else{

Loading…
Cancel
Save