mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-09-21 14:57:42 +00:00
Partial fix for mypy issues
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user