Просмотр исходного кода

tech(alerting): empty string does not update database

bergquist 9 лет назад
Родитель
Сommit
6d080904fa
1 измененных файлов с 1 добавлено и 2 удалено
  1. 1 2
      pkg/services/alerting/result_handler.go

+ 1 - 2
pkg/services/alerting/result_handler.go

@@ -29,7 +29,7 @@ func NewResultHandler() *DefaultResultHandler {
 func (handler *DefaultResultHandler) Handle(ctx *EvalContext) {
 func (handler *DefaultResultHandler) Handle(ctx *EvalContext) {
 	oldState := ctx.Rule.State
 	oldState := ctx.Rule.State
 
 
-	exeuctionError := ""
+	exeuctionError := " "
 	if ctx.Error != nil {
 	if ctx.Error != nil {
 		handler.log.Error("Alert Rule Result Error", "ruleId", ctx.Rule.Id, "error", ctx.Error)
 		handler.log.Error("Alert Rule Result Error", "ruleId", ctx.Rule.Id, "error", ctx.Error)
 		ctx.Rule.State = m.AlertStateExeuctionError
 		ctx.Rule.State = m.AlertStateExeuctionError
@@ -41,7 +41,6 @@ func (handler *DefaultResultHandler) Handle(ctx *EvalContext) {
 	}
 	}
 
 
 	countSeverity(ctx.Rule.Severity)
 	countSeverity(ctx.Rule.Severity)
-
 	if ctx.Rule.State != oldState {
 	if ctx.Rule.State != oldState {
 		handler.log.Info("New state change", "alertId", ctx.Rule.Id, "newState", ctx.Rule.State, "oldState", oldState)
 		handler.log.Info("New state change", "alertId", ctx.Rule.Id, "newState", ctx.Rule.State, "oldState", oldState)