From 4ba783c7963721ed8e49eb622b4f09f20c2aa1a0 Mon Sep 17 00:00:00 2001 From: Flowseal Date: Mon, 23 Nov 2026 06:32:26 +0300 Subject: [PATCH] time measure unification --- proxy/pool.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/proxy/pool.py b/proxy/pool.py index dadbc61..fb55ed4 100644 --- a/proxy/pool.py +++ b/proxy/pool.py @@ -405,14 +405,14 @@ class _CfWorkerPool: return domains def report_failure(self, worker_domain: str, exc: Exception) -> None: - now = time.time() + now = time.monotonic() if self._exhausted_until.get(worker_domain, 0) > now: return if isinstance(exc, WsHandshakeError): if exc.status_code == 429: # Workers free plan reports the daily request limit as 429. - exhausted_until = now + (86400 - (now % 86400)) + exhausted_until = now + (86400 - (time.time() % 86400)) reason = 'daily request limit' elif exc.status_code >= 500: exhausted_until = now + self.FAILURE_COOLDOWN