fix: 还原 inactive 路径 restartGateway + showTime keepalive

1. 还原 7737e08:removeProviderByName 重新调用 restartGateway(),
   inactive/active 状态变化均重启 gateway 使 openclaw.json 生效

2. led.js showTime() 加 30s keepalive 定时器:持续向 vfdservice
   管道写入,防止长时间无写入后管道"冷却",导致随后 showPin()
   调用 openSync(FIFO, 'w') 因无读端而阻塞、blink timer 无法触发

Made-with: Cursor
This commit is contained in:
stswangzhiping
2026-04-03 18:40:08 +08:00
parent 7737e08464
commit 66b94d828f
2 changed files with 8 additions and 4 deletions

View File

@@ -254,9 +254,15 @@ class Display {
showTime() {
this._stopBlink();
log.debug('display', '[vfd] #s1');
writeVfdPipeClock();
log.info('display', '显示屏 → 时间');
// 每 30s 刷新一次,保持 vfdservice 持续从管道读取,
// 防止长时间无写入后管道"冷却",导致后续 showPin 写入阻塞
const refresh = () => {
writeVfdPipeClock();
this._blinkTimer = setTimeout(refresh, 30_000);
};
this._blinkTimer = setTimeout(refresh, 30_000);
}
showPin(pin) {

View File

@@ -161,9 +161,7 @@ function removeProviderByName(providerId) {
}
log.info('openclaw-provider', `provider 已移除: ${providerId}`);
// 注意:此处不重启 gateway。inactive 期间 frp 隧道已断开,无人访问 gateway
// 下次 active 时 applyFullProviderFromVps 会写完整 config 并重启。
// 若在此处 kill gateway会破坏 vfdservice 管道,导致 PIN 码无法在数码管上闪烁。
restartGateway();
}
function removeProviderFromConfig(config, providerId) {