From e20f7049b3c5a39f775d97df6b30c74429be5b80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Mierzwa?= Date: Thu, 27 Jun 2019 16:43:55 +0100 Subject: [PATCH] fix(backend): ensure that we always use default timeout for am requests Timeout attribute for each alertmanager upstream should default to the value of alertmanager.timeout flag. Without that it will default to 0s which will cause it to timeout instantly --- internal/config/config.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/config/config.go b/internal/config/config.go index ee436f478..e6abcd351 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -172,6 +172,11 @@ func (config *configSchema) Read() { if err != nil { log.Fatal(err) } + for i, s := range config.Alertmanager.Servers { + if s.Timeout.Seconds() == 0 { + config.Alertmanager.Servers[i].Timeout = v.GetDuration("alertmanager.timeout") + } + } err = v.UnmarshalKey("jira", &config.JIRA) if err != nil {