Skip to content

Commit

Permalink
feat: add cluster returnPeerClient() func
Browse files Browse the repository at this point in the history
  • Loading branch information
stream1080 committed Oct 1, 2023
1 parent 3d868e0 commit 3a2751c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions cluster/com.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

0 comments on commit 3a2751c

Please sign in to comment.