forked from mirror/redis
Merge pull request #2272 from DomParfitt/fix-with-conn-cleanup
Capture error correctly in withConn
This commit is contained in:
commit
5350c18740
6
redis.go
6
redis.go
|
@ -288,11 +288,9 @@ func (c *baseClient) withConn(
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
defer func() {
|
err = fn(ctx, cn)
|
||||||
c.releaseConn(ctx, cn, err)
|
c.releaseConn(ctx, cn, err)
|
||||||
}()
|
return err
|
||||||
|
|
||||||
return fn(ctx, cn)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *baseClient) dial(ctx context.Context, network, addr string) (net.Conn, error) {
|
func (c *baseClient) dial(ctx context.Context, network, addr string) (net.Conn, error) {
|
||||||
|
|
Loading…
Reference in New Issue