Browse Source

[alert-script]alert msg should contains content

pull/3/MERGE
CalvinKirs 4 years ago
parent
commit
c4131d9fb1
  1. 1
      dolphinscheduler-alert-plugin/dolphinscheduler-alert-script/src/main/java/org/apache/dolphinscheduler/plugin/alert/script/ScriptSender.java
  2. 7
      dolphinscheduler-alert-plugin/dolphinscheduler-alert-script/src/main/java/org/apache/dolphinscheduler/plugin/alert/script/StreamGobbler.java

1
dolphinscheduler-alert-plugin/dolphinscheduler-alert-script/src/main/java/org/apache/dolphinscheduler/plugin/alert/script/ScriptSender.java

@ -43,6 +43,7 @@ public class ScriptSender {
userParams = config.get(ScriptParamsConstants.NAME_SCRIPT_USER_PARAMS); userParams = config.get(ScriptParamsConstants.NAME_SCRIPT_USER_PARAMS);
} }
//fixme
AlertResult sendScriptAlert(String msg) { AlertResult sendScriptAlert(String msg) {
AlertResult alertResult = new AlertResult(); AlertResult alertResult = new AlertResult();
if (ScriptType.of(scriptType).equals(ScriptType.SHELL)) { if (ScriptType.of(scriptType).equals(ScriptType.SHELL)) {

7
dolphinscheduler-alert-plugin/dolphinscheduler-alert-script/src/main/java/org/apache/dolphinscheduler/plugin/alert/script/StreamGobbler.java

@ -55,6 +55,13 @@ public class StreamGobbler extends Thread {
} }
} catch (IOException e) { } catch (IOException e) {
logger.error("I/O error occurs {}", e.getMessage()); logger.error("I/O error occurs {}", e.getMessage());
} finally {
try {
inputBufferReader.close();
inputStreamReader.close();
} catch (IOException e) {
logger.error("I/O error occurs {}", e.getMessage());
}
} }
} }

Loading…
Cancel
Save