From 62c44b262a7ed9ebd66b33cb9d5e4b3bcb2d3ffc Mon Sep 17 00:00:00 2001 From: Misaka_Company Date: Fri, 24 Jul 2026 08:59:56 +0800 Subject: [PATCH] fix: launch page.goto uses domcontentloaded to avoid slow-site timeout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit launch_and_prepare opened each site with Playwright's default wait_until='load', which waits for every resource (ads/trackers/images). sxne.sxjdfreight.com (顺心) reliably takes >30s to fire load, so its goto timed out and — launch not being retried — killed the whole worker, leaving only one page open. Switch the two launch gotos to wait_until='domcontentloaded' (return as soon as the DOM is ready; the readiness polling still gates login). Behavior for already-fast sites unchanged. Co-Authored-By: Claude --- inbound_verify/runtime.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/inbound_verify/runtime.py b/inbound_verify/runtime.py index 27bd9a4..7ee839a 100644 --- a/inbound_verify/runtime.py +++ b/inbound_verify/runtime.py @@ -306,13 +306,15 @@ def launch_and_prepare(debug_mode=False, debug_target=""): for acct in range(1, 3): print(f">> 正在启动【顺心】账号{acct}标签页: {url}") sx_page = context.new_page() - sx_page.goto(url) + # domcontentloaded:DOM 就绪即返回,不等慢资源(广告/图片)的 load 事件, + # 避免顺心等站点 load 超 30s 导致整个 worker 启动失败。就绪轮询自会判登录态。 + sx_page.goto(url, wait_until="domcontentloaded") sx_pages.append(sx_page) pages_map["顺心"] = sx_pages else: print(f">> 正在启动【{site_name}】页面: {url}") page = context.new_page() - page.goto(url) + page.goto(url, wait_until="domcontentloaded") pages_map[site_name] = page # 4. 安能 Electron