From 8bb4f73a38c9cc031dcdba9d9a960eda48289535 Mon Sep 17 00:00:00 2001 From: FileGo Date: Fri, 27 May 2022 21:22:00 +0100 Subject: [PATCH] Removed net.Error.Temporary (#536) --- lists/downloader.go | 2 +- resolver/upstream_resolver.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lists/downloader.go b/lists/downloader.go index c683d86d5..c86bf3250 100644 --- a/lists/downloader.go +++ b/lists/downloader.go @@ -115,7 +115,7 @@ func (d *HTTPDownloader) DownloadFile(link string) (io.ReadCloser, error) { return fmt.Errorf("got status code %d", resp.StatusCode) } var netErr net.Error - if errors.As(httpErr, &netErr) && (netErr.Timeout() || netErr.Temporary()) { + if errors.As(httpErr, &netErr) && netErr.Timeout() { return &TransientError{inner: netErr} } diff --git a/resolver/upstream_resolver.go b/resolver/upstream_resolver.go index 37e5d1395..544fddf54 100644 --- a/resolver/upstream_resolver.go +++ b/resolver/upstream_resolver.go @@ -266,7 +266,7 @@ func (r *UpstreamResolver) Resolve(request *model.Request) (response *model.Resp retry.RetryIf(func(err error) bool { var netErr net.Error - return errors.As(err, &netErr) && (netErr.Timeout() || netErr.Temporary()) + return errors.As(err, &netErr) && netErr.Timeout() }), retry.OnRetry(func(n uint, err error) { logger.WithFields(logrus.Fields{