diff --git a/cluster/com.go b/cluster/com.go index 95d8ccc..a215758 100644 --- a/cluster/com.go +++ b/cluster/com.go @@ -24,3 +24,12 @@ func (cluster *ClusterDatabases) getPeerClient(peer string) (*client.Client, err return c, nil } + +func (cluster *ClusterDatabases) returnPeerClient(peer string, client *client.Client) error { + pool, ok := cluster.peerConn[peer] + if !ok { + return errors.New("conn not found") + } + + return pool.ReturnObject(context.Background(), client) +}