Skip to content

Commit af502bc

Browse files
committed
fix: use sequential approach
1 parent 9875f8e commit af502bc

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

providers/dns/corenetworks/corenetworks.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ const (
2222
EnvTTL = envNamespace + "TTL"
2323
EnvPropagationTimeout = envNamespace + "PROPAGATION_TIMEOUT"
2424
EnvPollingInterval = envNamespace + "POLLING_INTERVAL"
25+
EnvSequenceInterval = envNamespace + "SEQUENCE_INTERVAL"
2526
EnvHTTPTimeout = envNamespace + "HTTP_TIMEOUT"
2627
)
2728

@@ -31,6 +32,7 @@ type Config struct {
3132
Password string
3233
PropagationTimeout time.Duration
3334
PollingInterval time.Duration
35+
SequenceInterval time.Duration
3436
TTL int
3537
HTTPClient *http.Client
3638
}
@@ -41,6 +43,7 @@ func NewDefaultConfig() *Config {
4143
TTL: env.GetOrDefaultInt(EnvTTL, 3600),
4244
PropagationTimeout: env.GetOrDefaultSecond(EnvPropagationTimeout, dns01.DefaultPropagationTimeout),
4345
PollingInterval: env.GetOrDefaultSecond(EnvPollingInterval, dns01.DefaultPollingInterval),
46+
SequenceInterval: env.GetOrDefaultSecond(EnvSequenceInterval, dns01.DefaultPropagationTimeout),
4447
HTTPClient: &http.Client{
4548
Timeout: env.GetOrDefaultSecond(EnvHTTPTimeout, 30*time.Second),
4649
},
@@ -93,6 +96,12 @@ func (d *DNSProvider) Timeout() (timeout, interval time.Duration) {
9396
return d.config.PropagationTimeout, d.config.PollingInterval
9497
}
9598

99+
// Sequential All DNS challenges for this provider will be resolved sequentially.
100+
// Returns the interval between each iteration.
101+
func (d *DNSProvider) Sequential() time.Duration {
102+
return d.config.SequenceInterval
103+
}
104+
96105
// Present creates a TXT record using the specified parameters.
97106
func (d *DNSProvider) Present(domain, token, keyAuth string) error {
98107
info := dns01.GetChallengeInfo(domain, keyAuth)

providers/dns/corenetworks/corenetworks.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ lego --email myemail@example.com --dns corenetworks --domains my.example.org run
1919
CORENETWORKS_PROPAGATION_TIMEOUT = "Maximum waiting time for DNS propagation"
2020
CORENETWORKS_TTL = "The TTL of the TXT record used for the DNS challenge"
2121
CORENETWORKS_HTTP_TIMEOUT = "API request timeout"
22+
CORENETWORKS_SEQUENCE_INTERVAL = "Time between sequential requests"
2223

2324
[Links]
2425
API = "https://beta.api.core-networks.de/doc/"

0 commit comments

Comments
 (0)