Skip to content

Commit

Permalink
dnsredir.go: Refine
Browse files Browse the repository at this point in the history
  • Loading branch information
leiless committed Jan 5, 2022
1 parent e2ad429 commit 0bfd647
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions dnsredir.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,10 @@ func (r *Dnsredir) ServeDNS(ctx context.Context, w dns.ResponseWriter, req *dns.
var upstreamErr error
var tryCount int32
deadline := time.Now().Add(defaultTimeout)
tryCount = 0
for time.Now().Before(deadline) {
tryCount += 1
start := time.Now()

tryCount++
host := upstream.Select()
if host == nil || tryCount > upstream.maxRetry {
log.Debug(errNoHealthy)
Expand Down

0 comments on commit 0bfd647

Please sign in to comment.