chore: 同步本地更改
- 新增 aio-mcp 项目框架 - 新增 .trae/skills/ OCR/SKU 设计工具 - 更新 auto-check 配置和 stress 包 - 删除 fnhelp 文档目录 - 更新 Docker 压力测试脚本
This commit is contained in:
@@ -46,6 +46,20 @@ func Connect(ip string, cfg *Config) (*ssh.Client, error) {
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("SSH 连接 %s 失败: %w", addr, err)
|
||||
}
|
||||
|
||||
// KeepAlive:长时压测(如 fnstable 门禁的 memtester 可达 30-120 分钟)期间
|
||||
// 连接上无数据流动,定期发 keepalive 请求防止 NAT/防火墙掐断空闲 TCP 连接。
|
||||
// 连接关闭后 SendRequest 返回错误,goroutine 自行退出。
|
||||
go func() {
|
||||
ticker := time.NewTicker(30 * time.Second)
|
||||
defer ticker.Stop()
|
||||
for range ticker.C {
|
||||
if _, _, err := client.SendRequest("keepalive@golang.org", true, nil); err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
||||
return client, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user