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.

48 lines
1.8 KiB

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.

/** BullMQ 队列名 */
export const RPA_QUEUE_NAME = "quote-rpa";
/** Worker 并发Playwright 会话串行锁1 避免多 job 争用 orphan active */
export const RPA_WORKER_CONCURRENCY = 1;
/** 报价入口 page.goto 超时(毫秒);慢网/Cloudflare 场景需更长 */
export const RPA_PAGE_GOTO_TIMEOUT_MS = 45_000;
/** 单 job 超时毫秒Playwright 填表+抓价上限 */
export const RPA_JOB_TIMEOUT_MS = 360_000;
/** 街道地址输入框 click/focus 超时(毫秒) */
export const RPA_STREET_INPUT_CLICK_MS = 8_000;
/** job 最大尝试次数(含首次 = 1 次重试) */
export const RPA_JOB_ATTEMPTS = 2;
/** 地址联想等待超时(毫秒) */
export const ADDRESS_SUGGESTION_TIMEOUT_MS = 5_000;
/** 地址候选 API 联想等待毫秒Headless 下 Places 响应较慢 */
export const ADDRESS_CANDIDATE_SUGGESTION_TIMEOUT_MS = 12_000;
/** 报价 widget hydration 等待毫秒en-US 首页渲染较慢,显式等待至元素就绪 */
export const RPA_WIDGET_HYDRATION_TIMEOUT_MS = 60_000;
/** 复用 quote_session storageState 时的 widget 就绪等待(毫秒) */
export const RPA_SESSION_WIDGET_TIMEOUT_MS = 15_000;
/** 地址候选 RPA 全流程上限(毫秒):与 Next route maxDuration=300 对齐 */
export const ADDRESS_CANDIDATES_TIMEOUT_MS = 300_000;
/** CAPTCHA 触发的 Worker 暂停时长(分钟) */
export const CAPTCHA_PAUSE_MINUTES = 10;
/** Worker 心跳 TTL */
export const WORKER_HEARTBEAT_TTL_SECONDS = 30;
/** 报价完成信号等待上限(毫秒) */
export const RPA_QUOTE_CAPTURE_TIMEOUT_MS = 25_000;
/** 提交后额外收集 XHR 的短暂窗口(毫秒) */
export const RPA_QUOTE_POST_SUBMIT_SETTLE_MS = 2_000;
/** 偏差预警阈值5% */
export const PRICE_DEVIATION_THRESHOLD = 0.05;