fix: only run configureOpenClaw once per clawId, not on every WS reconnect
Made-with: Cursor
This commit is contained in:
@@ -52,6 +52,9 @@ class ClawClient {
|
||||
// 最近一次 WS 错误是否是证书时间问题(NTP 未同步)
|
||||
this._certTimeError = false;
|
||||
|
||||
// 记录已为哪个 clawId 配置过 openclaw(防止 WS 重连时重复执行)
|
||||
this._openClawConfigured = null;
|
||||
|
||||
// systemd watchdog
|
||||
this._sdTimer = null;
|
||||
|
||||
@@ -391,9 +394,12 @@ class ClawClient {
|
||||
led.status.setApps();
|
||||
led.display.showTime();
|
||||
log.info('clawd', `已激活 claw_id = ${this._cfg.claw_id}`);
|
||||
if (this._cfg.claw_id && this._openClawConfigured !== this._cfg.claw_id) {
|
||||
this._openClawConfigured = this._cfg.claw_id;
|
||||
this._configureOpenClaw(this._cfg.claw_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ── OpenClaw 配置 ────────────────────────────────────────────────────────────
|
||||
|
||||
|
||||
Reference in New Issue
Block a user