Kaynağa Gözat

feat(alerting): make sure the map contains the responding alert

bergquist 9 yıl önce
ebeveyn
işleme
448ee5812c
1 değiştirilmiş dosya ile 3 ekleme ve 1 silme
  1. 3 1
      pkg/services/alerting/alerting.go

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

@@ -129,7 +129,9 @@ func (this *Scheduler) Executor(executor Executor) {
 func (this *Scheduler) HandleResponses() {
 func (this *Scheduler) HandleResponses() {
 	for response := range this.responseQueue {
 	for response := range this.responseQueue {
 		log.Info("Response: alert %d returned %s", response.id, response.state)
 		log.Info("Response: alert %d returned %s", response.id, response.state)
-		this.jobs[response.id].running = false
+		if this.jobs[response.id] != nil {
+			this.jobs[response.id].running = false
+		}
 	}
 	}
 }
 }