mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Alerting: Remove dead evalRunning guard in rule routine (#88312)
Remove dead guard
This commit is contained in:
@@ -217,7 +217,6 @@ func (a *alertRule) Run(key ngmodels.AlertRuleKey) error {
|
|||||||
logger := a.logger.FromContext(grafanaCtx)
|
logger := a.logger.FromContext(grafanaCtx)
|
||||||
logger.Debug("Alert rule routine started")
|
logger.Debug("Alert rule routine started")
|
||||||
|
|
||||||
evalRunning := false
|
|
||||||
var currentFingerprint fingerprint
|
var currentFingerprint fingerprint
|
||||||
defer a.stopApplied(key)
|
defer a.stopApplied(key)
|
||||||
for {
|
for {
|
||||||
@@ -239,19 +238,14 @@ func (a *alertRule) Run(key ngmodels.AlertRuleKey) error {
|
|||||||
logger.Debug("Evaluation channel has been closed. Exiting")
|
logger.Debug("Evaluation channel has been closed. Exiting")
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
if evalRunning {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
func() {
|
func() {
|
||||||
orgID := fmt.Sprint(key.OrgID)
|
orgID := fmt.Sprint(key.OrgID)
|
||||||
evalDuration := a.metrics.EvalDuration.WithLabelValues(orgID)
|
evalDuration := a.metrics.EvalDuration.WithLabelValues(orgID)
|
||||||
evalTotal := a.metrics.EvalTotal.WithLabelValues(orgID)
|
evalTotal := a.metrics.EvalTotal.WithLabelValues(orgID)
|
||||||
|
|
||||||
evalRunning = true
|
|
||||||
evalStart := a.clock.Now()
|
evalStart := a.clock.Now()
|
||||||
defer func() {
|
defer func() {
|
||||||
evalRunning = false
|
|
||||||
a.evalApplied(key, ctx.scheduledAt)
|
a.evalApplied(key, ctx.scheduledAt)
|
||||||
evalDuration.Observe(a.clock.Now().Sub(evalStart).Seconds())
|
evalDuration.Observe(a.clock.Now().Sub(evalStart).Seconds())
|
||||||
}()
|
}()
|
||||||
|
|||||||
Reference in New Issue
Block a user