- Pass min servers to resolve call - Set settings when constructing resolver - Construct resolver in each provider updater - No more common resolver for all providers
29 lines
627 B
Go
29 lines
627 B
Go
package surfshark
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/qdm12/gluetun/internal/updater/resolver"
|
|
)
|
|
|
|
func newParallelResolver() (parallelResolver resolver.Parallel) {
|
|
const (
|
|
maxFailRatio = 0.1
|
|
maxDuration = 20 * time.Second
|
|
betweenDuration = time.Second
|
|
maxNoNew = 2
|
|
maxFails = 2
|
|
)
|
|
settings := resolver.ParallelSettings{
|
|
MaxFailRatio: maxFailRatio,
|
|
Repeat: resolver.RepeatSettings{
|
|
MaxDuration: maxDuration,
|
|
BetweenDuration: betweenDuration,
|
|
MaxNoNew: maxNoNew,
|
|
MaxFails: maxFails,
|
|
SortIPs: true,
|
|
},
|
|
}
|
|
return resolver.NewParallelResolver(settings)
|
|
}
|