mirror of
https://github.com/openclaw/openclaw.git
synced 2026-10-03 01:29:56 +00:00
refactor: keep transport readiness independent of global logging (#147676)
This commit is contained in:
parent
da39dbae88
commit
bcb8fa7b2b
1 changed files with 5 additions and 3 deletions
|
|
@ -1,6 +1,6 @@
|
|||
// Polls channel transports until they are ready for runtime work.
|
||||
import { resolveTimerTimeoutMs } from "@openclaw/normalization-core/number-coercion";
|
||||
import { danger } from "../globals.js";
|
||||
import { theme } from "../../packages/terminal-core/src/theme.js";
|
||||
import type { RuntimeEnv } from "../runtime.js";
|
||||
import { sleepWithAbort } from "./backoff.js";
|
||||
|
||||
|
|
@ -55,7 +55,9 @@ export async function waitForTransportReady(params: WaitForTransportReadyParams)
|
|||
if (now >= nextLogAt) {
|
||||
const elapsedMs = now - started;
|
||||
params.runtime.error?.(
|
||||
danger(`${params.label} not ready after ${elapsedMs}ms (${lastError ?? "unknown error"})`),
|
||||
theme.error(
|
||||
`${params.label} not ready after ${elapsedMs}ms (${lastError ?? "unknown error"})`,
|
||||
),
|
||||
);
|
||||
nextLogAt = now + logIntervalMs;
|
||||
}
|
||||
|
|
@ -73,7 +75,7 @@ export async function waitForTransportReady(params: WaitForTransportReadyParams)
|
|||
}
|
||||
|
||||
params.runtime.error?.(
|
||||
danger(`${params.label} not ready after ${timeoutMs}ms (${lastError ?? "unknown error"})`),
|
||||
theme.error(`${params.label} not ready after ${timeoutMs}ms (${lastError ?? "unknown error"})`),
|
||||
);
|
||||
throw new Error(`${params.label} not ready (${lastError ?? "unknown error"})`);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue