mirror of
https://github.com/coredns/coredns.git
synced 2025-10-28 00:34:24 -04:00
middleware/httproxy: smaller timeouts
Make the timeouts smaller after we fail to connect.
This commit is contained in:
@@ -73,7 +73,7 @@ func (g *google) Exchange(req *dns.Msg) (*dns.Msg, error) {
|
||||
|
||||
timeout := addr.FailTimeout
|
||||
if timeout == 0 {
|
||||
timeout = 10 * time.Second
|
||||
timeout = 5 * time.Second
|
||||
}
|
||||
atomic.AddInt32(&addr.Fails, 1)
|
||||
go func(host *proxy.UpstreamHost, timeout time.Duration) {
|
||||
@@ -185,7 +185,7 @@ func (g *google) lookup(r *dns.Msg) ([]string, error) {
|
||||
|
||||
timeout := host.FailTimeout
|
||||
if timeout == 0 {
|
||||
timeout = 10 * time.Second
|
||||
timeout = 7 * time.Second
|
||||
}
|
||||
atomic.AddInt32(&host.Fails, 1)
|
||||
go func(host *proxy.UpstreamHost, timeout time.Duration) {
|
||||
|
||||
Reference in New Issue
Block a user