File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -295,8 +295,18 @@ func checkURL(urlToGet *url.URL, fragments []string) int {
295295 }
296296
297297 if resp , err = netClient .Do (req ); err != nil {
298- fmt .Printf (" FAILED error: %v\n " , err )
299- return 1
298+ if isTimeout (err ) {
299+ fmt .Println (" request timed out, backing off for one minute" )
300+ time .Sleep (1 * time .Minute )
301+
302+ if resp , err = netClient .Do (req ); err != nil {
303+ fmt .Printf (" FAILED error: %v\n " , err )
304+ return 1
305+ }
306+ } else {
307+ fmt .Printf (" FAILED error: %v\n " , err )
308+ return 1
309+ }
300310 }
301311
302312 retryCount := 10
@@ -363,6 +373,10 @@ func checkURL(urlToGet *url.URL, fragments []string) int {
363373 return 0
364374}
365375
376+ func isTimeout (err error ) bool {
377+ return strings .Contains (err .Error (), "i/o timeout" )
378+ }
379+
366380func checkFragment (fragment , pageContent string ) bool {
367381 var headings []string
368382
You can’t perform that action at this time.
0 commit comments