From 0b9deee486a80917d61b506f5c929550fb89aa04 Mon Sep 17 00:00:00 2001 From: Fabian Reinartz Date: Sun, 27 Sep 2015 20:21:29 +0200 Subject: [PATCH] Fix uninstantiated notifier opts --- notify.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/notify.go b/notify.go index 826bea4e..f48b66d9 100644 --- a/notify.go +++ b/notify.go @@ -150,7 +150,7 @@ func (n *routedNotifier) Notify(ctx context.Context, alerts ...*types.Alert) err // Populate the context with the the filtering options // of the notifier. - ctx = context.WithValue(ctx, notifyRepeatInterval, opts.RepeatInterval) + ctx = context.WithValue(ctx, notifyRepeatInterval, time.Duration(opts.RepeatInterval)) ctx = context.WithValue(ctx, notifySendResolved, opts.SendResolved) notifier = n.decorate(notifier) @@ -163,6 +163,11 @@ func (n *routedNotifier) ApplyConfig(conf *config.Config) { defer n.mtx.Unlock() n.notifiers = n.build(conf) + n.notifierOpts = map[string]*config.NotificationConfig{} + + for _, opts := range conf.NotificationConfigs { + n.notifierOpts[opts.Name] = opts + } } // mutingNotifier wraps a notifier and applies a Silencer