mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
lib/promscrape/discoveryutils: use correct timeout for blocking requests (#3609)
Signed-off-by: Zakhar Bessarab <z.bessarab@victoriametrics.com> Signed-off-by: Zakhar Bessarab <z.bessarab@victoriametrics.com>
This commit is contained in:
parent
41e00a0df7
commit
5df9fddaf2
1 changed files with 1 additions and 1 deletions
|
@ -207,7 +207,7 @@ func (c *Client) getAPIResponseWithParamsAndClient(client *HTTPClient, path stri
|
|||
return nil, fmt.Errorf("cannot parse %q: %w", requestURL, err)
|
||||
}
|
||||
|
||||
deadline := time.Now().Add(client.WriteTimeout)
|
||||
deadline := time.Now().Add(client.ReadTimeout)
|
||||
ctx, cancel := context.WithDeadline(c.clientCtx, deadline)
|
||||
defer cancel()
|
||||
req, err := http.NewRequestWithContext(ctx, "GET", u.String(), nil)
|
||||
|
|
Loading…
Reference in a new issue