Fix changes

This commit is contained in:
Gaurav Singh 2020-05-16 20:22:12 -04:00
parent 87e7d77e15
commit 0d0af48444

View File

@ -321,17 +321,13 @@ func (c *AvailableConditionController) sync(key string) error {
// we had trouble with slow dial and DNS responses causing us to wait too long.
// we added this as insurance
case <-time.After(6 * time.Second):
defer func() {
// errCh needs to have a reader since the above goroutine doing the work
// needs to send to it. This is defered to ensure it runs
// even if the post timeout work itself panics.
go func() {
res := <-errch
if res != nil {
fmt.Error("%v", res)
}
}()
}()
// errCh needs to have a reader since the above goroutine doing the work
// needs to send to it.
go func() {
if res := <-errch; res != nil {
fmt.Errorf("timed out response from %v: %v", discoveryURL, res)
}
}()
results <- fmt.Errorf("timed out waiting for %v", discoveryURL)
return
}