Partial fix for mypy issues

This commit is contained in:
Ian Renton
2026-09-20 20:42:16 +01:00
parent 93ea27510f
commit 203758fa2d
25 changed files with 244 additions and 147 deletions
+4 -5
View File
@@ -2,8 +2,7 @@ import threading
from datetime import timedelta
from typing import Any
from requests import Response
from requests_cache import CachedSession
from requests_cache import AnyResponse, CachedSession
from core.data_store import CACHE_DIR
@@ -22,8 +21,8 @@ class URLDataCache(CachedSession):
expire_after=timedelta(days=1),
allowable_codes=(200, 400, 401, 403, 404),
)
self._lock = threading.Lock()
self._get_lock = threading.Lock()
def get(self, *args: Any, **kwargs: Any) -> Response:
with self._lock:
def get(self, *args: Any, **kwargs: Any) -> AnyResponse:
with self._get_lock:
return super().get(*args, **kwargs)