浏览代码

style(alerting): rename max retries

bergquist 9 年之前
父节点
当前提交
ca33622698
共有 3 个文件被更改,包括 3 次插入3 次删除
  1. 1 1
      pkg/services/alerting/alerting.go
  2. 1 1
      pkg/services/alerting/engine.go
  3. 1 1
      pkg/services/alerting/models.go

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

@@ -6,7 +6,7 @@ import (
 )
 )
 
 
 var (
 var (
-	maxRetries = 3
+	maxAlertExecutionRetries = 3
 )
 )
 
 
 var engine *Engine
 var engine *Engine

+ 1 - 1
pkg/services/alerting/engine.go

@@ -118,7 +118,7 @@ func (e *Engine) resultHandler() {
 				e.log.Error("Alert Rule Result Error After Max Retries", "ruleId", result.AlertJob.Rule.Id, "error", result.Error, "retry", result.AlertJob.RetryCount)
 				e.log.Error("Alert Rule Result Error After Max Retries", "ruleId", result.AlertJob.Rule.Id, "error", result.Error, "retry", result.AlertJob.RetryCount)
 
 
 				result.State = alertstates.Critical
 				result.State = alertstates.Critical
-				result.Description = fmt.Sprintf("Failed to run check after %d retires, Error: %v", maxRetries, result.Error)
+				result.Description = fmt.Sprintf("Failed to run check after %d retires, Error: %v", maxAlertExecutionRetries, result.Error)
 				e.saveState(result)
 				e.saveState(result)
 			}
 			}
 		} else {
 		} else {

+ 1 - 1
pkg/services/alerting/models.go

@@ -9,7 +9,7 @@ type AlertJob struct {
 }
 }
 
 
 func (aj *AlertJob) Retryable() bool {
 func (aj *AlertJob) Retryable() bool {
-	return aj.RetryCount < maxRetries
+	return aj.RetryCount < maxAlertExecutionRetries
 }
 }
 
 
 func (aj *AlertJob) ResetRetry() {
 func (aj *AlertJob) ResetRetry() {