mirror of
https://gitee.com/dromara/mayfly-go
synced 2026-01-05 06:05:48 +08:00
refactor: pool get options支持不创建连接
This commit is contained in:
@@ -53,10 +53,7 @@ func GetMachineCli(ctx context.Context, authCertName string, getMachine func(str
|
||||
// 删除指定机器缓存客户端,并关闭客户端连接
|
||||
func DeleteCli(id uint64) {
|
||||
for _, p := range poolGroup.AllPool() {
|
||||
if p.Stats().TotalConns == 0 {
|
||||
continue
|
||||
}
|
||||
conn, err := p.Get(context.Background(), pool.WithNoUpdateLastActive())
|
||||
conn, err := p.Get(context.Background(), pool.WithGetNoUpdateLastActive(), pool.WithGetNoNewConn())
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user