only log first error if retrying during get

This commit is contained in:
Ted Unangst 2019-07-18 15:13:10 -04:00
parent 99b4d9f521
commit 68bed3837c
1 changed files with 1 additions and 1 deletions

View File

@ -128,10 +128,10 @@ func GetJunkTimeout(url string, timeout time.Duration) (junk.Junk, error) {
} }
resp, err := client.Do(req) resp, err := client.Do(req)
if err != nil { if err != nil {
log.Printf("first get failed: %s", err)
if timeout > 0 || !strings.Contains(err.Error(), "TLS handshake timeout") { if timeout > 0 || !strings.Contains(err.Error(), "TLS handshake timeout") {
return nil, err return nil, err
} }
log.Printf("first get failed: %s", err)
resp, err = client.Do(req) resp, err = client.Do(req)
if err != nil { if err != nil {
return nil, err return nil, err