浏览代码

fix message "empty scenario"

mmetc 2 年之前
父节点
当前提交
76ea3a063f
共有 1 个文件被更改,包括 2 次插入3 次删除
  1. 2 3
      pkg/database/alerts.go

+ 2 - 3
pkg/database/alerts.go

@@ -64,17 +64,16 @@ func formatAlertAsString(machineId string, alert *models.Alert) []string {
 	}
 
 	/**/
-	reason := ""
 	msg := ""
 	if alert.Scenario != nil && *alert.Scenario != "" {
 		msg = *alert.Scenario
 	} else if alert.Message != nil && *alert.Message != "" {
 		msg = *alert.Message
 	} else {
-		msg = fmt.Sprintf("empty scenario by %s", src)
+		msg = "empty scenario"
 	}
 
-	reason = fmt.Sprintf("%s by %s", msg, src)
+	reason := fmt.Sprintf("%s by %s", msg, src)
 
 	if len(alert.Decisions) > 0 {
 		for i, decisionItem := range alert.Decisions {