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:
parent
56bf666b0c
commit
a2e21d61f8
@ -217,7 +217,6 @@ func (a *alertRule) Run(key ngmodels.AlertRuleKey) error {
|
||||
logger := a.logger.FromContext(grafanaCtx)
|
||||
logger.Debug("Alert rule routine started")
|
||||
|
||||
evalRunning := false
|
||||
var currentFingerprint fingerprint
|
||||
defer a.stopApplied(key)
|
||||
for {
|
||||
@ -239,19 +238,14 @@ func (a *alertRule) Run(key ngmodels.AlertRuleKey) error {
|
||||
logger.Debug("Evaluation channel has been closed. Exiting")
|
||||
return nil
|
||||
}
|
||||
if evalRunning {
|
||||
continue
|
||||
}
|
||||
|
||||
func() {
|
||||
orgID := fmt.Sprint(key.OrgID)
|
||||
evalDuration := a.metrics.EvalDuration.WithLabelValues(orgID)
|
||||
evalTotal := a.metrics.EvalTotal.WithLabelValues(orgID)
|
||||
|
||||
evalRunning = true
|
||||
evalStart := a.clock.Now()
|
||||
defer func() {
|
||||
evalRunning = false
|
||||
a.evalApplied(key, ctx.scheduledAt)
|
||||
evalDuration.Observe(a.clock.Now().Sub(evalStart).Seconds())
|
||||
}()
|
||||
|
Loading…
Reference in New Issue
Block a user