mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00:00
CLOUDFLARE: Increase retry limits (#1713)
* change policy to 20, 1, 120 (20 retries, min delay 1 sec, max delay 2 minutes)
This commit is contained in:
@ -496,11 +496,16 @@ func newCloudflare(m map[string]string, metadata json.RawMessage) (providers.DNS
|
||||
return nil, fmt.Errorf("if cloudflare apitoken is set, apikey and apiuser should not be provided")
|
||||
}
|
||||
|
||||
optRP := cloudflare.UsingRetryPolicy(20, 1, 120)
|
||||
// UsingRetryPolicy is documented here:
|
||||
// https://pkg.go.dev/github.com/cloudflare/cloudflare-go#UsingRetryPolicy
|
||||
// The defaults are UsingRetryPolicy(3, 1, 30)
|
||||
|
||||
var err error
|
||||
if m["apitoken"] != "" {
|
||||
api.cfClient, err = cloudflare.NewWithAPIToken(m["apitoken"])
|
||||
api.cfClient, err = cloudflare.NewWithAPIToken(m["apitoken"], optRP)
|
||||
} else {
|
||||
api.cfClient, err = cloudflare.New(m["apikey"], m["apiuser"])
|
||||
api.cfClient, err = cloudflare.New(m["apikey"], m["apiuser"], optRP)
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user