Support default dc idx from configs

This commit is contained in:
9seconds
2018-09-21 09:47:37 +03:00
parent 8268620615
commit 1e9bbfae55
24 changed files with 187 additions and 123 deletions
+3 -3
View File
@@ -99,15 +99,15 @@ func (c *Conn) doIO(callback ioFunc, p []byte, timeout time.Duration) (int, erro
case res := <-resChan:
timer.Stop()
if res.err != nil {
c.Close()
c.Close() // nolint: gosec
}
return res.n, res.err
case <-c.ctx.Done():
timer.Stop()
c.Close()
c.Close() // nolint: gosec
return 0, errors.Annotate(c.ctx.Err(), "Cannot do IO because context is closed")
case <-timer.C:
c.Close()
c.Close() // nolint: gosec
return 0, errors.Annotate(c.ctx.Err(), "Timeout on IO operation")
}
}