@@ -10,6 +10,7 @@ import (
1010
1111	"github.com/go-acme/lego/v4/challenge/dns01" 
1212	"github.com/go-acme/lego/v4/platform/config/env" 
13+ 	"github.com/go-acme/lego/v4/platform/wait" 
1314	"github.com/go-acme/lego/v4/providers/dns/f5xc/internal" 
1415)
1516
@@ -127,21 +128,29 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error {
127128			},
128129		}
129130
130- 		_ , err  =  d .client .CreateRRSet (context .Background (), dns01 .UnFqdn (authZone ), d .config .GroupName , rrSet )
131- 		if  err  !=  nil  {
132- 			return  fmt .Errorf ("f5xc: create RR set: %w" , err )
133- 		}
131+ 		wait .For ("f5xc create" , 60 * time .Second , 2 * time .Second , func () (bool , error ) {
132+ 			_ , err  =  d .client .CreateRRSet (context .Background (), dns01 .UnFqdn (authZone ), d .config .GroupName , rrSet )
133+ 			if  err  !=  nil  {
134+ 				return  false , fmt .Errorf ("f5xc: create RR set: %w" , err )
135+ 			}
136+ 
137+ 			return  true , nil 
138+ 		})
134139
135140		return  nil 
136141	}
137142
138143	// Update RRSet. 
139144	existingRRSet .RRSet .TXTRecord .Values  =  append (existingRRSet .RRSet .TXTRecord .Values , info .Value )
140145
141- 	_ , err  =  d .client .ReplaceRRSet (context .Background (), dns01 .UnFqdn (authZone ), d .config .GroupName , subDomain , "TXT" , existingRRSet .RRSet )
142- 	if  err  !=  nil  {
143- 		return  fmt .Errorf ("f5xc: replace RR set: %w" , err )
144- 	}
146+ 	wait .For ("f5xc replace" , 60 * time .Second , 2 * time .Second , func () (bool , error ) {
147+ 		_ , err  =  d .client .ReplaceRRSet (context .Background (), dns01 .UnFqdn (authZone ), d .config .GroupName , subDomain , "TXT" , existingRRSet .RRSet )
148+ 		if  err  !=  nil  {
149+ 			return  false , fmt .Errorf ("f5xc: replace RR set: %w" , err )
150+ 		}
151+ 
152+ 		return  true , nil 
153+ 	})
145154
146155	return  nil 
147156}
0 commit comments