You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
579 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

/**
* embed 前端轮询上限
* 须 ≥ SESSION_MAX_ROTATIONS × 单轮 RPA 耗时3×~60s客户端仅 NEXT_PUBLIC_ 生效
*/
export const FLOCK_POLL_TIMEOUT_DEFAULT_MS = 210_000;
/** 浏览器端可读NEXT_PUBLIC_服务端可读 FLOCK_POLL_TIMEOUT_MS */
export function getFlockPollTimeoutMs(): number {
const raw =
process.env.NEXT_PUBLIC_FLOCK_POLL_TIMEOUT_MS ??
process.env.FLOCK_POLL_TIMEOUT_MS ??
String(FLOCK_POLL_TIMEOUT_DEFAULT_MS);
const n = Number(raw);
return Number.isFinite(n) && n > 0 ? n : FLOCK_POLL_TIMEOUT_DEFAULT_MS;
}