mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2025-12-09 13:46:07 +08:00
CLOUDFLAREAPI: FIX: Preventing segfault when Cloudflare API limit is reached (#1530)
* Preventing segfault when Cloudflare API limit is reached Signed-off-by: Jan-Philipp Benecke <jan-philipp@bnck.me> * Add comment for future me Signed-off-by: Jan-Philipp Benecke <jan-philipp@bnck.me>
This commit is contained in:
parent
490f1d6184
commit
60324bc4f5
1 changed files with 7 additions and 3 deletions
|
|
@ -150,9 +150,13 @@ func (c *cloudflareProvider) createRec(rec *models.RecordConfig, domainID string
|
|||
} else if rec.Type == "DS" {
|
||||
cf.Data = cfDSData(rec)
|
||||
}
|
||||
resp, err := c.cfClient.CreateDNSRecord(context.Background(), domainID, cf)
|
||||
id = resp.Result.ID
|
||||
if resp, err := c.cfClient.CreateDNSRecord(context.Background(), domainID, cf); err != nil {
|
||||
return err
|
||||
} else {
|
||||
// Updating id (from the outer scope) by side-effect, required for updating proxy mode
|
||||
id = resp.Result.ID
|
||||
return nil
|
||||
}
|
||||
},
|
||||
}}
|
||||
if rec.Metadata[metaProxy] != "off" {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue