mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-03 16:24:05 +00:00
24 lines
677 B
TypeScript
24 lines
677 B
TypeScript
import { readPositiveIntEnv } from "./lib/env-limits.mjs";
|
|
|
|
export type McpChannelLimits = {
|
|
connectTimeoutMs: number;
|
|
gatewayEventRetainLimit: number;
|
|
rawMessageRetainLimit: number;
|
|
};
|
|
|
|
export function readMcpChannelLimits(env: NodeJS.ProcessEnv = process.env): McpChannelLimits {
|
|
return {
|
|
connectTimeoutMs: readPositiveIntEnv("OPENCLAW_MCP_CHANNELS_CONNECT_TIMEOUT_MS", 60_000, env),
|
|
gatewayEventRetainLimit: readPositiveIntEnv(
|
|
"OPENCLAW_MCP_CHANNELS_GATEWAY_EVENT_RETAIN_LIMIT",
|
|
2_000,
|
|
env,
|
|
),
|
|
rawMessageRetainLimit: readPositiveIntEnv(
|
|
"OPENCLAW_MCP_CHANNELS_RAW_MESSAGE_RETAIN_LIMIT",
|
|
2_000,
|
|
env,
|
|
),
|
|
};
|
|
}
|