fix: some issue

This commit is contained in:
meilin.huang
2025-05-23 17:26:12 +08:00
parent 778cb7f4de
commit 666b191b6c
25 changed files with 758 additions and 98 deletions

View File

@@ -18,7 +18,7 @@ func GetMachineCli(ctx context.Context, authCertName string, getMachine func(str
return nil, err
}
mi.Key = authCertName
return mi.Conn(ctx)
return mi.Conn(context.Background())
})
if err != nil {
@@ -31,9 +31,10 @@ func GetMachineCli(ctx context.Context, authCertName string, getMachine func(str
// 删除指定机器缓存客户端,并关闭客户端连接
func DeleteCli(id uint64) {
for _, pool := range poolGroup.AllPool() {
ctx, cancelFunc := context.WithCancel(context.Background())
defer cancelFunc()
conn, err := pool.Get(ctx)
if pool.Stats().TotalConns == 0 {
continue
}
conn, err := pool.Get(context.Background())
if err != nil {
continue
}