Commit 9d3659d3 by bergquist

improve local variable name

parent b45a1bd4
...@@ -59,14 +59,14 @@ func (n *notificationService) SendIfNeeded(context *EvalContext) error { ...@@ -59,14 +59,14 @@ func (n *notificationService) SendIfNeeded(context *EvalContext) error {
} }
func (n *notificationService) sendAndMarkAsComplete(evalContext *EvalContext, notifierState *notifierState) error { func (n *notificationService) sendAndMarkAsComplete(evalContext *EvalContext, notifierState *notifierState) error {
not := notifierState.notifier notifier := notifierState.notifier
n.log.Debug("Sending notification", "type", not.GetType(), "id", not.GetNotifierId(), "isDefault", not.GetIsDefault()) n.log.Debug("Sending notification", "type", notifier.GetType(), "id", notifier.GetNotifierId(), "isDefault", notifier.GetIsDefault())
metrics.M_Alerting_Notification_Sent.WithLabelValues(not.GetType()).Inc() metrics.M_Alerting_Notification_Sent.WithLabelValues(notifier.GetType()).Inc()
err := not.Notify(evalContext) err := notifier.Notify(evalContext)
if err != nil { if err != nil {
n.log.Error("failed to send notification", "id", not.GetNotifierId()) n.log.Error("failed to send notification", "id", notifier.GetNotifierId())
} else { } else {
notifierState.state.UpdatedAt = time.Now().UTC().Unix() notifierState.state.UpdatedAt = time.Now().UTC().Unix()
} }
...@@ -76,13 +76,13 @@ func (n *notificationService) sendAndMarkAsComplete(evalContext *EvalContext, no ...@@ -76,13 +76,13 @@ func (n *notificationService) sendAndMarkAsComplete(evalContext *EvalContext, no
} }
cmd := &m.SetAlertNotificationStateToCompleteCommand{ cmd := &m.SetAlertNotificationStateToCompleteCommand{
Id: not.GetNotifierId(), Id: notifier.GetNotifierId(),
Version: notifierState.state.Version, Version: notifierState.state.Version,
} }
if err = bus.DispatchCtx(evalContext.Ctx, cmd); err != nil { if err = bus.DispatchCtx(evalContext.Ctx, cmd); err != nil {
if err == m.ErrAlertNotificationStateVersionConflict { if err == m.ErrAlertNotificationStateVersionConflict {
n.log.Error("notification state out of sync", "id", not.GetNotifierId()) n.log.Error("notification state out of sync", "id", notifier.GetNotifierId())
return nil return nil
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment