mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2025-12-11 22:56:09 +08:00
CSCGLOBAL: Use slow and safe algorithm (#1663)
* Fix broken test * CLOUDFLARE: Fix missing nameserver bug * CSCGLOBAL: Catch more status states * wip! * remove extra print * Revert to the slow+safe CSC algorithm
This commit is contained in:
parent
dd3416674f
commit
ec8bfe4b6d
1 changed files with 7 additions and 4 deletions
|
|
@ -391,10 +391,10 @@ func (client *providerClient) sendZoneEditRequest(domainname string, edits []zon
|
||||||
// NB(tlim): The request was successfully submitted. The "statusURL" is what we query if we want to wait until the request was processed and see if it was a success.
|
// NB(tlim): The request was successfully submitted. The "statusURL" is what we query if we want to wait until the request was processed and see if it was a success.
|
||||||
// Right now we don't want to wait. Instead, the next time we do a mutation we wait then.
|
// Right now we don't want to wait. Instead, the next time we do a mutation we wait then.
|
||||||
// If we ever change our mind and want to wait for success/failure, it would look like:
|
// If we ever change our mind and want to wait for success/failure, it would look like:
|
||||||
//statusURL := errResp.Links.Status
|
statusURL := errResp.Links.Status
|
||||||
//return client.waitRequestURL(statusURL)
|
return client.waitRequestURL(statusURL)
|
||||||
|
|
||||||
return nil
|
//return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (client *providerClient) waitRequest(reqID string) error {
|
func (client *providerClient) waitRequest(reqID string) error {
|
||||||
|
|
@ -463,6 +463,9 @@ type pagedZoneEditResponsePagedZoneEditResponse struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (client *providerClient) clearRequests(domain string) error {
|
func (client *providerClient) clearRequests(domain string) error {
|
||||||
|
if cscDebug {
|
||||||
|
printer.Printf("DEBUG: Clearing requests\n")
|
||||||
|
}
|
||||||
var bodyString, err = client.get("/zones/edits?filter=zoneName==" + domain)
|
var bodyString, err = client.get("/zones/edits?filter=zoneName==" + domain)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
@ -472,7 +475,7 @@ func (client *providerClient) clearRequests(domain string) error {
|
||||||
json.Unmarshal(bodyString, &dr)
|
json.Unmarshal(bodyString, &dr)
|
||||||
|
|
||||||
// TODO(tlim): Properly handle paganation.
|
// TODO(tlim): Properly handle paganation.
|
||||||
if dr.Meta.Pages != 1 {
|
if dr.Meta.Pages > 1 {
|
||||||
return fmt.Errorf("cancelPendingEdits failed: Pages=%d", dr.Meta.Pages)
|
return fmt.Errorf("cancelPendingEdits failed: Pages=%d", dr.Meta.Pages)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue