mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 06:22:42 +00:00
Status scan: overlap non-JSON async checks
This commit is contained in:
@@ -194,16 +194,25 @@ export async function scanStatus(
|
|||||||
progress.setLabel("Loading config…");
|
progress.setLabel("Loading config…");
|
||||||
const cfg = loadConfig();
|
const cfg = loadConfig();
|
||||||
const osSummary = resolveOsSummary();
|
const osSummary = resolveOsSummary();
|
||||||
|
const tailscaleMode = cfg.gateway?.tailscale?.mode ?? "off";
|
||||||
|
const tailscaleDnsPromise =
|
||||||
|
tailscaleMode === "off"
|
||||||
|
? Promise.resolve<string | null>(null)
|
||||||
|
: getTailnetHostname((cmd, args) =>
|
||||||
|
runExec(cmd, args, { timeoutMs: 1200, maxBuffer: 200_000 }),
|
||||||
|
).catch(() => null);
|
||||||
|
const updateTimeoutMs = opts.all ? 6500 : 2500;
|
||||||
|
const updatePromise = getUpdateCheckResult({
|
||||||
|
timeoutMs: updateTimeoutMs,
|
||||||
|
fetchGit: true,
|
||||||
|
includeRegistry: true,
|
||||||
|
});
|
||||||
|
const agentStatusPromise = getAgentLocalStatuses();
|
||||||
|
const summaryPromise = getStatusSummary();
|
||||||
progress.tick();
|
progress.tick();
|
||||||
|
|
||||||
progress.setLabel("Checking Tailscale…");
|
progress.setLabel("Checking Tailscale…");
|
||||||
const tailscaleMode = cfg.gateway?.tailscale?.mode ?? "off";
|
const tailscaleDns = await tailscaleDnsPromise;
|
||||||
const tailscaleDns =
|
|
||||||
tailscaleMode === "off"
|
|
||||||
? null
|
|
||||||
: await getTailnetHostname((cmd, args) =>
|
|
||||||
runExec(cmd, args, { timeoutMs: 1200, maxBuffer: 200_000 }),
|
|
||||||
).catch(() => null);
|
|
||||||
const tailscaleHttpsUrl =
|
const tailscaleHttpsUrl =
|
||||||
tailscaleMode !== "off" && tailscaleDns
|
tailscaleMode !== "off" && tailscaleDns
|
||||||
? `https://${tailscaleDns}${normalizeControlUiBasePath(cfg.gateway?.controlUi?.basePath)}`
|
? `https://${tailscaleDns}${normalizeControlUiBasePath(cfg.gateway?.controlUi?.basePath)}`
|
||||||
@@ -211,16 +220,11 @@ export async function scanStatus(
|
|||||||
progress.tick();
|
progress.tick();
|
||||||
|
|
||||||
progress.setLabel("Checking for updates…");
|
progress.setLabel("Checking for updates…");
|
||||||
const updateTimeoutMs = opts.all ? 6500 : 2500;
|
const update = await updatePromise;
|
||||||
const update = await getUpdateCheckResult({
|
|
||||||
timeoutMs: updateTimeoutMs,
|
|
||||||
fetchGit: true,
|
|
||||||
includeRegistry: true,
|
|
||||||
});
|
|
||||||
progress.tick();
|
progress.tick();
|
||||||
|
|
||||||
progress.setLabel("Resolving agents…");
|
progress.setLabel("Resolving agents…");
|
||||||
const agentStatus = await getAgentLocalStatuses();
|
const agentStatus = await agentStatusPromise;
|
||||||
progress.tick();
|
progress.tick();
|
||||||
|
|
||||||
progress.setLabel("Probing gateway…");
|
progress.setLabel("Probing gateway…");
|
||||||
@@ -289,7 +293,7 @@ export async function scanStatus(
|
|||||||
progress.tick();
|
progress.tick();
|
||||||
|
|
||||||
progress.setLabel("Reading sessions…");
|
progress.setLabel("Reading sessions…");
|
||||||
const summary = await getStatusSummary();
|
const summary = await summaryPromise;
|
||||||
progress.tick();
|
progress.tick();
|
||||||
|
|
||||||
progress.setLabel("Rendering…");
|
progress.setLabel("Rendering…");
|
||||||
|
|||||||
Reference in New Issue
Block a user