- Fix CLI operation not setting DNS server - Fix periodic operation not setting DNS server - Set DNS address for resolution once at start for both CLI and periodic operation - Inject resolver to each provider instead of creating it within - Use resolver settings on every call to `.Resolve` method, instead of passing it to constructor - Move out minServers check from resolver
29 lines
615 B
Go
29 lines
615 B
Go
package updater
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/qdm12/gluetun/internal/updater/resolver"
|
|
)
|
|
|
|
func parallelResolverSettings(hosts []string) (settings resolver.ParallelSettings) {
|
|
const (
|
|
maxFailRatio = 0.1
|
|
maxDuration = 20 * time.Second
|
|
betweenDuration = time.Second
|
|
maxNoNew = 2
|
|
maxFails = 2
|
|
)
|
|
return resolver.ParallelSettings{
|
|
Hosts: hosts,
|
|
MaxFailRatio: maxFailRatio,
|
|
Repeat: resolver.RepeatSettings{
|
|
MaxDuration: maxDuration,
|
|
BetweenDuration: betweenDuration,
|
|
MaxNoNew: maxNoNew,
|
|
MaxFails: maxFails,
|
|
SortIPs: true,
|
|
},
|
|
}
|
|
}
|