Files
gluetun/internal/provider/ivpn/updater/resolve.go

29 lines
626 B
Go
Raw Normal View History

package updater
2021-05-31 00:11:16 +00:00
import (
"time"
"github.com/qdm12/gluetun/internal/updater/resolver"
)
func newParallelResolver() (parallelResolver *resolver.Parallel) {
2021-05-31 00:11:16 +00:00
const (
maxFailRatio = 0.1
maxDuration = 20 * time.Second
betweenDuration = time.Second
maxNoNew = 2
maxFails = 2
)
settings := resolver.ParallelSettings{
2021-05-31 00:11:16 +00:00
MaxFailRatio: maxFailRatio,
Repeat: resolver.RepeatSettings{
MaxDuration: maxDuration,
BetweenDuration: betweenDuration,
MaxNoNew: maxNoNew,
MaxFails: maxFails,
SortIPs: true,
2021-05-31 00:11:16 +00:00
},
}
return resolver.NewParallelResolver(settings)
2021-05-31 00:11:16 +00:00
}