(ctx context.Context, cn *pool.Conn, err error)
| 796 | } |
| 797 | |
| 798 | func (c *baseClient) releaseConn(ctx context.Context, cn *pool.Conn, err error) { |
| 799 | if c.opt.Limiter != nil { |
| 800 | c.opt.Limiter.ReportResult(err) |
| 801 | } |
| 802 | |
| 803 | if isBadConn(err, false, c.opt.Addr) { |
| 804 | c.connPool.Remove(ctx, cn, err) |
| 805 | } else { |
| 806 | // process any pending push notifications before returning the connection to the pool |
| 807 | if err := c.processPushNotifications(ctx, cn); err != nil { |
| 808 | internal.Logger.Printf(ctx, "push: error processing pending notifications before releasing connection: %v", err) |
| 809 | } |
| 810 | c.connPool.Put(ctx, cn) |
| 811 | } |
| 812 | } |
| 813 | |
| 814 | func (c *baseClient) withConn( |
| 815 | ctx context.Context, fn func(context.Context, *pool.Conn) error, |
no test coverage detected