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 未同步)
|
// 最近一次 WS 错误是否是证书时间问题(NTP 未同步)
|
||||||
this._certTimeError = false;
|
this._certTimeError = false;
|
||||||
|
|
||||||
|
// 记录已为哪个 clawId 配置过 openclaw(防止 WS 重连时重复执行)
|
||||||
|
this._openClawConfigured = null;
|
||||||
|
|
||||||
// systemd watchdog
|
// systemd watchdog
|
||||||
this._sdTimer = null;
|
this._sdTimer = null;
|
||||||
|
|
||||||
@@ -391,7 +394,10 @@ class ClawClient {
|
|||||||
led.status.setApps();
|
led.status.setApps();
|
||||||
led.display.showTime();
|
led.display.showTime();
|
||||||
log.info('clawd', `已激活 claw_id = ${this._cfg.claw_id}`);
|
log.info('clawd', `已激活 claw_id = ${this._cfg.claw_id}`);
|
||||||
this._configureOpenClaw(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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user