From fb9a1a872e4255eda50483cae3f456c45ac99b36 Mon Sep 17 00:00:00 2001 From: Julien Pivotto Date: Sat, 20 Jun 2020 09:45:28 +0200 Subject: [PATCH] DigitalOcean: limit refresh timeout (#7425) Signed-off-by: Julien Pivotto --- discovery/digitalocean/digitalocean.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/discovery/digitalocean/digitalocean.go b/discovery/digitalocean/digitalocean.go index a80a45d52..dc13ba12c 100644 --- a/discovery/digitalocean/digitalocean.go +++ b/discovery/digitalocean/digitalocean.go @@ -58,7 +58,7 @@ var DefaultSDConfig = SDConfig{ type SDConfig struct { HTTPClientConfig config_util.HTTPClientConfig `yaml:",inline"` - RefreshInterval model.Duration `yaml:"refresh_interval,omitempty"` + RefreshInterval model.Duration `yaml:"refresh_interval"` Port int `yaml:"port"` } @@ -95,7 +95,7 @@ func NewDiscovery(conf *SDConfig, logger log.Logger) (*Discovery, error) { d.client, err = godo.New( &http.Client{ Transport: rt, - Timeout: 5 * time.Duration(conf.RefreshInterval), + Timeout: time.Duration(conf.RefreshInterval), }, godo.SetUserAgent(fmt.Sprintf("Prometheus/%s", version.Version)), )