Browse Source

fix:send output

zqbao 3 months ago
parent
commit
1322e668f8
1 changed files with 1 additions and 1 deletions
  1. 1 1
      services/data/stl/stl.go

+ 1 - 1
services/data/stl/stl.go

@@ -512,11 +512,11 @@ print(output)
 	pythonCode = fmt.Sprintf(pythonCode, path, period, seasonal, trend, fraction, seasonalDeg, trendDeg, lowPassDeg, robustStr, toPath)
 	cmd := exec.Command(`python3`, "-c", pythonCode)
 	output, err := cmd.CombinedOutput()
+	alarm_msg.SendAlarmMsg(string(output), 1)
 	if err != nil {
 		utils.FileLog.Info("execStlPythonCode error:%s, input: path:%s, toPath:%s, period:%d, seasonal:%d, trendDeg:%d, seasonalDeg:%d, lowPassDeg:%d, fraction:%g, robust:%s", err.Error(), path, toPath, period, seasonal, trend, trendDeg, seasonalDeg, lowPassDeg, fraction, robust)
 		return
 	}
-	alarm_msg.SendAlarmMsg(string(output), 1)
 	defer cmd.Process.Kill()
 	if err = json.Unmarshal(output, &stlResult); err != nil {
 		utils.FileLog.Info("execStlPythonCode Unmarshal error:%s, input: path:%s, toPath:%s, period:%d, seasonal:%d, trendDeg:%d, seasonalDeg:%d, lowPassDeg:%d, fraction:%g, robust:%s, output:%s", err.Error(), path, toPath, period, seasonal, trend, trendDeg, seasonalDeg, lowPassDeg, fraction, robust, string(output))