Skip to content

Commit

Permalink
Retry when status code equal 999
Browse files Browse the repository at this point in the history
  • Loading branch information
theblackturtle committed Feb 9, 2020
1 parent bb1a0ab commit 97af5a1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions core/crawler.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,12 @@ func (crawler *Crawler) Start() {
if response.StatusCode == 404 || response.StatusCode == 429 || response.StatusCode == 0 {
return
}

// Retry if status code == 999
if response.StatusCode == 999 {
_ = response.Request.Retry()
}

u := response.Request.URL.String()
outputFormat := fmt.Sprintf("[url] - [code-%d] - %s", response.StatusCode, u)
fmt.Println(outputFormat)
Expand Down

0 comments on commit 97af5a1

Please sign in to comment.