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
This commit is contained in:
Łukasz Mierzwa
2019-06-27 16:43:55 +01:00
parent c21f251f59
commit e20f7049b3

View File

@@ -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 {