Retry requests support implemented for client.

This commit is contained in:
Musab Gültekin
2019-07-04 13:36:10 +03:00
parent da03567fae
commit 9adff75509
10 changed files with 108 additions and 34 deletions

View File

@ -40,7 +40,8 @@ type Options struct {
// Concurrent requests per domain limit
ConcurrentRequestsPerDomain int
// User Agent. Default: "Geziyor 1.0"
// User Agent.
// Default: "Geziyor 1.0"
UserAgent string
// Request delays
@ -69,6 +70,16 @@ type Options struct {
// Charset Detection disable
CharsetDetectDisabled bool
// Maximum number of times to retry, in addition to the first download.
// Set -1 to disable retrying
// Default: 2
RetryTimes int
// Which HTTP response codes to retry.
// Other errors (DNS lookup issues, connections lost, etc) are always retried.
// Default: []int{500, 502, 503, 504, 522, 524, 408}
RetryHTTPCodes []int
// If true, HTML parsing is disabled to improve performance.
ParseHTMLDisabled bool