mirror of
https://github.com/qingchencloud/clawpanel.git
synced 2026-05-11 18:10:41 +08:00
- #160 Gateway 死循環: _autoPairAndReconnect 后不调用 reconnect() 避免重置计数器 - #165 readConfig 未定义: 替换为内联 fs.readFileSync/writeFileSync - #156 systemd PATH: findOpenclawBin 添加 npm 全局路径, systemd 服务注入 PATH - #159 Docker 双容器冲突: 新增 DISABLE_GATEWAY_SPAWN 环境变量开关 - #151 Gateway 检测冲突: linuxCheckGateway 验证进程名, 拒绝操作非 OpenClaw 进程
This commit is contained in:
@@ -324,12 +324,16 @@ export class WsClient {
|
||||
console.warn('[ws] reloadGateway 失败(非致命):', e)
|
||||
}
|
||||
|
||||
console.log('[ws] 配对成功,2秒后重新连接...')
|
||||
// 修复 #160: 不调用 reconnect()(它会重置 _autoPairAttempts 导致无限循环),
|
||||
// 而是直接重连一次。如果仍然失败,_autoPairAttempts 不会被重置,不会再次触发自动修复。
|
||||
console.log('[ws] 配对成功,3秒后重新连接...')
|
||||
setTimeout(() => {
|
||||
if (!this._intentionalClose) {
|
||||
this.reconnect()
|
||||
this._reconnectAttempts = 0
|
||||
this._closeWs()
|
||||
this._doConnect()
|
||||
}
|
||||
}, 2000)
|
||||
}, 3000)
|
||||
} catch (e) {
|
||||
console.error('[ws] 自动配对失败:', e)
|
||||
this._setConnected(false, 'error', `配对失败: ${e}`)
|
||||
|
||||
Reference in New Issue
Block a user