File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -209,12 +209,12 @@ func (d *dnsResolver) watcher() {
209209 err = d .cc .UpdateState (* state )
210210 }
211211
212- var waitTime time.Duration
212+ var nextResolutionTime time.Time
213213 if err == nil {
214214 // Success resolving, wait for the next ResolveNow. However, also wait 30
215215 // seconds at the very least to prevent constantly re-resolving.
216216 backoffIndex = 1
217- waitTime = MinResolutionInterval
217+ nextResolutionTime = time . Now (). Add ( MinResolutionInterval )
218218 select {
219219 case <- d .ctx .Done ():
220220 return
@@ -223,13 +223,13 @@ func (d *dnsResolver) watcher() {
223223 } else {
224224 // Poll on an error found in DNS Resolver or an error received from
225225 // ClientConn.
226- waitTime = backoff .DefaultExponential .Backoff (backoffIndex )
226+ nextResolutionTime = time . Now (). Add ( backoff .DefaultExponential .Backoff (backoffIndex ) )
227227 backoffIndex ++
228228 }
229229 select {
230230 case <- d .ctx .Done ():
231231 return
232- case <- internal .TimeAfterFunc (waitTime ):
232+ case <- internal .TimeAfterFunc (time . Until ( nextResolutionTime ) ):
233233 }
234234 }
235235}
You can’t perform that action at this time.
0 commit comments