(addr string, client PoolClient)
| 176 | } |
| 177 | |
| 178 | func (p *Pool) closeClient(addr string, client PoolClient) { |
| 179 | if p.clientsMetric != nil { |
| 180 | p.clientsMetric.Add(-1) |
| 181 | } |
| 182 | // Close in the background since this operation may take awhile and we have a mutex |
| 183 | go func(addr string, closer PoolClient) { |
| 184 | if err := closer.Close(); err != nil { |
| 185 | level.Error(p.logger).Log("msg", fmt.Sprintf("error closing connection to %s", p.clientName), "addr", addr, "err", err) |
| 186 | } |
| 187 | }(addr, client) |
| 188 | } |
| 189 | |
| 190 | // RemoveClient removes the client instance from the pool if it is still there and not cleaned up by health check. |
| 191 | // The value of client needs to be the same as returned by GetClientForInstance or GetClientFor. |
no test coverage detected