small fix

This commit is contained in:
iamqizhao
2015-08-03 11:45:42 -07:00
committed by yangzhouhan
parent b3a7314a90
commit 0fb69761f0

View File

@ -236,11 +236,11 @@ func (cc *ClientConn) WaitForStateChange(timeout time.Duration, sourceState Conn
if sourceState != cc.state {
return true
}
done := make(chan struct{})
expired := timeout <= time.Since(start)
if expired {
return false
}
done := make(chan struct{})
go func() {
select {
case <-time.After(timeout-time.Since(start)):