fix: getDashboardInfo uses spawn+Promise to handle long-running process

Made-with: Cursor
This commit is contained in:
stswangzhiping
2026-03-15 14:09:41 +08:00
parent 516d0d26ee
commit 64cd7432e1
2 changed files with 41 additions and 22 deletions

View File

@@ -20,10 +20,9 @@ class ClawClient {
this._dashInfo = {}; // { dashboard_token, dashboard_port }
}
start() {
async start() {
console.log(`[clawd] 启动中... 服务器 = ${this._cfg.server}`);
// 启动前提取 openclaw dashboard 信息(耗时操作放后台,不阻塞连接)
this._dashInfo = getDashboardInfo();
this._dashInfo = await getDashboardInfo();
this._connect();
}