1
0
mirror of https://github.com/redis/go-redis.git synced 2025-07-29 17:41:15 +03:00

Close all connections.

This commit is contained in:
Vladimir Mihailenco
2013-11-07 16:20:15 +02:00
parent ab4d0d6b62
commit 3f491f8a8c
5 changed files with 294 additions and 240 deletions

View File

@ -113,7 +113,7 @@ func (c *baseClient) run(cmd Cmder) {
}
if err := c.writeCmd(cn, cmd); err != nil {
c.removeConn(cn)
c.freeConn(cn, err)
cmd.setErr(err)
return
}
@ -173,10 +173,7 @@ func newClient(opt *Options, dial func() (net.Conn, error)) *Client {
baseClient: &baseClient{
opt: opt,
connPool: newConnPool(
dial, opt.getPoolSize(),
opt.IdleTimeout,
),
connPool: newConnPool(newConnFunc(dial), opt.getPoolSize(), opt.IdleTimeout),
},
}
}