fix(xquik): make attempt timestamp sentinel explicit

This commit is contained in:
Shadowbroker
2026-08-23 01:46:26 -06:00
parent 3124827738
commit b06adeab46
+3 -3
View File
@@ -28,7 +28,7 @@ _cache_lock = threading.Lock()
_cache_signature: tuple[str, int] | None = None _cache_signature: tuple[str, int] | None = None
_cache_entries: list[dict[str, Any]] = [] _cache_entries: list[dict[str, Any]] = []
_attempt_signature: tuple[str, int, str] | None = None _attempt_signature: tuple[str, int, str] | None = None
_last_attempt_at = 0.0 _last_attempt_at: float | None = None
def xquik_fetch_enabled() -> bool: def xquik_fetch_enabled() -> bool:
@@ -159,7 +159,7 @@ def fetch_xquik_entries() -> list[dict[str, Any]]:
now = time.monotonic() now = time.monotonic()
if ( if (
_attempt_signature == attempt_signature _attempt_signature == attempt_signature
and _last_attempt_at and _last_attempt_at is not None
and now - _last_attempt_at < interval_seconds and now - _last_attempt_at < interval_seconds
): ):
if _cache_signature == cache_signature: if _cache_signature == cache_signature:
@@ -188,4 +188,4 @@ def _reset_cache_for_tests() -> None:
_cache_signature = None _cache_signature = None
_cache_entries = [] _cache_entries = []
_attempt_signature = None _attempt_signature = None
_last_attempt_at = 0.0 _last_attempt_at = None