Return original error on resources.GetRemote retry timeouts

See #11327
This commit is contained in:
Bjørn Erik Pedersen
2023-08-04 18:46:47 +02:00
parent 16da1ade70
commit 22861cb4dc
2 changed files with 39 additions and 17 deletions

View File

@@ -159,7 +159,8 @@ func (c *Client) FromRemote(uri string, optionsm map[string]any) (resource.Resou
if start.IsZero() {
start = time.Now()
} else if d := time.Since(start) + nextSleep; d >= c.rs.Cfg.Timeout() {
return nil, fmt.Errorf("timeout (configured to %s) fetching remote resource %s: last error: %w", c.rs.Cfg.Timeout(), uri, err)
c.rs.Logger.Errorf("Retry timeout (configured to %s) fetching remote resource.", c.rs.Cfg.Timeout())
return nil, err
}
time.Sleep(nextSleep)
if nextSleep < nextSleepLimit {