From 789cb3205b4f6757db710b74f84e4b574d2f0a7e Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Thu, 5 Mar 2026 11:27:47 -0500 Subject: [PATCH] refactor(timeouts): extract `BROWSER_SUBMIT_NAV_TIMEOUT` --- scrapers/codeforces.py | 3 ++- scrapers/timeouts.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/scrapers/codeforces.py b/scrapers/codeforces.py index 75d9915..2335da7 100644 --- a/scrapers/codeforces.py +++ b/scrapers/codeforces.py @@ -21,6 +21,7 @@ from .models import ( from .timeouts import ( BROWSER_NAV_TIMEOUT, BROWSER_SESSION_TIMEOUT, + BROWSER_SUBMIT_NAV_TIMEOUT, HTTP_TIMEOUT, ) @@ -396,7 +397,7 @@ def _submit_headless( try: page.wait_for_url( lambda url: "/my" in url or "/status" in url, - timeout=BROWSER_NAV_TIMEOUT * 2, + timeout=BROWSER_SUBMIT_NAV_TIMEOUT, ) except Exception: err_el = page.query_selector("span.error") diff --git a/scrapers/timeouts.py b/scrapers/timeouts.py index a21ad0d..8a002a2 100644 --- a/scrapers/timeouts.py +++ b/scrapers/timeouts.py @@ -2,6 +2,7 @@ HTTP_TIMEOUT = 15.0 BROWSER_SESSION_TIMEOUT = 15000 BROWSER_NAV_TIMEOUT = 10000 +BROWSER_SUBMIT_NAV_TIMEOUT = BROWSER_NAV_TIMEOUT * 2 BROWSER_TURNSTILE_POLL = 5000 BROWSER_ELEMENT_WAIT = 10000 BROWSER_SETTLE_DELAY = 500