mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-05 12:40:20 +00:00
fix: address review comments
- Use optional timeoutMs parameter (undefined = use config/default) - Extract DEFAULT_IMESSAGE_PROBE_TIMEOUT_MS to shared constants.ts - Import constant in client.ts instead of hardcoding - Re-export constant from probe.ts for backwards compatibility
This commit is contained in:
committed by
Peter Steinberger
parent
78f8a29071
commit
f633a8cb22
@@ -2,6 +2,7 @@ import { type ChildProcessWithoutNullStreams, spawn } from "node:child_process";
|
||||
import { createInterface, type Interface } from "node:readline";
|
||||
import type { RuntimeEnv } from "../runtime.js";
|
||||
import { resolveUserPath } from "../utils.js";
|
||||
import { DEFAULT_IMESSAGE_PROBE_TIMEOUT_MS } from "./constants.js";
|
||||
|
||||
export type IMessageRpcError = {
|
||||
code?: number;
|
||||
@@ -149,8 +150,7 @@ export class IMessageRpcClient {
|
||||
params: params ?? {},
|
||||
};
|
||||
const line = `${JSON.stringify(payload)}\n`;
|
||||
// Default timeout matches DEFAULT_IMESSAGE_PROBE_TIMEOUT_MS from probe.ts
|
||||
const timeoutMs = opts?.timeoutMs ?? 10_000;
|
||||
const timeoutMs = opts?.timeoutMs ?? DEFAULT_IMESSAGE_PROBE_TIMEOUT_MS;
|
||||
|
||||
const response = new Promise<T>((resolve, reject) => {
|
||||
const key = String(id);
|
||||
|
||||
Reference in New Issue
Block a user