fix(gandi.net): leave ttl as it is if not user specified

This commit is contained in:
Quentin McGaw
2024-11-07 09:22:15 +00:00
parent 46e1edb8f2
commit 9caf1bef53

View File

@@ -126,17 +126,12 @@ func (p *Provider) Update(ctx context.Context, client *http.Client, ip netip.Add
buffer := bytes.NewBuffer(nil)
encoder := json.NewEncoder(buffer)
const defaultTTL uint32 = 3600
ttl := defaultTTL
if p.ttl != 0 {
ttl = p.ttl
}
requestData := struct {
Values [1]string `json:"rrset_values"`
TTL uint32 `json:"rrset_ttl"`
TTL uint32 `json:"rrset_ttl,omitempty"`
}{
Values: [1]string{ip.Unmap().String()},
TTL: ttl,
TTL: p.ttl,
}
err = encoder.Encode(requestData)
if err != nil {