fix: shorten doctor gateway health timeout in non-interactive
This commit is contained in:
@@ -6,11 +6,16 @@ import { note } from "../terminal/note.js";
|
|||||||
import { healthCommand } from "./health.js";
|
import { healthCommand } from "./health.js";
|
||||||
import { formatHealthCheckFailure } from "./health-format.js";
|
import { formatHealthCheckFailure } from "./health-format.js";
|
||||||
|
|
||||||
export async function checkGatewayHealth(params: { runtime: RuntimeEnv; cfg: ClawdbotConfig }) {
|
export async function checkGatewayHealth(params: {
|
||||||
|
runtime: RuntimeEnv;
|
||||||
|
cfg: ClawdbotConfig;
|
||||||
|
timeoutMs?: number;
|
||||||
|
}) {
|
||||||
const gatewayDetails = buildGatewayConnectionDetails({ config: params.cfg });
|
const gatewayDetails = buildGatewayConnectionDetails({ config: params.cfg });
|
||||||
|
const timeoutMs = typeof params.timeoutMs === "number" && params.timeoutMs > 0 ? params.timeoutMs : 10_000;
|
||||||
let healthOk = false;
|
let healthOk = false;
|
||||||
try {
|
try {
|
||||||
await healthCommand({ json: false, timeoutMs: 10_000 }, params.runtime);
|
await healthCommand({ json: false, timeoutMs }, params.runtime);
|
||||||
healthOk = true;
|
healthOk = true;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
const message = String(err);
|
const message = String(err);
|
||||||
|
|||||||
@@ -233,7 +233,11 @@ export async function doctorCommand(
|
|||||||
|
|
||||||
noteWorkspaceStatus(cfg);
|
noteWorkspaceStatus(cfg);
|
||||||
|
|
||||||
const { healthOk } = await checkGatewayHealth({ runtime, cfg });
|
const { healthOk } = await checkGatewayHealth({
|
||||||
|
runtime,
|
||||||
|
cfg,
|
||||||
|
timeoutMs: options.nonInteractive === true ? 3000 : 10_000,
|
||||||
|
});
|
||||||
await maybeRepairGatewayDaemon({
|
await maybeRepairGatewayDaemon({
|
||||||
cfg,
|
cfg,
|
||||||
runtime,
|
runtime,
|
||||||
|
|||||||
Reference in New Issue
Block a user