|
8 | 8 | from pathlib import Path |
9 | 9 | from typing import Any, Optional, Sequence |
10 | 10 |
|
11 | | -from ..config import Config |
12 | | - |
13 | 11 | logger = logging.getLogger(__name__) |
14 | 12 |
|
15 | 13 | YESTERDAY_DATE = datetime.now() - timedelta(days=1) |
@@ -61,6 +59,8 @@ def get_recent_time_window( |
61 | 59 |
|
62 | 60 | """ |
63 | 61 | # Check for manual recovery override |
| 62 | + from ..config import Config # noqa: PLC0415 |
| 63 | + |
64 | 64 | if Config.RECOVERY_MODE: |
65 | 65 | logger.warning("Recovery mode enabled - pulling full day's data") |
66 | 66 | now = datetime.now() |
@@ -167,7 +167,7 @@ def _is_expired(self, timestamp: str) -> bool: |
167 | 167 | entry_time = datetime.fromisoformat(timestamp) |
168 | 168 | expiry_time = entry_time + timedelta(minutes=self.ttl_minutes) |
169 | 169 | return datetime.now() > expiry_time |
170 | | - except (ValueError, TypeError): |
| 170 | + except ValueError, TypeError: |
171 | 171 | return True |
172 | 172 |
|
173 | 173 | def is_processed(self, record_id: str | int, data: Optional[Any] = None) -> bool: |
@@ -351,7 +351,7 @@ def get_stats(self) -> dict[str, Any]: |
351 | 351 | latest_timestamp = max( |
352 | 352 | str(ts) for ts in timestamps if ts is not None |
353 | 353 | ) |
354 | | - except (TypeError, ValueError): |
| 354 | + except TypeError, ValueError: |
355 | 355 | latest_timestamp = None |
356 | 356 |
|
357 | 357 | return { |
|
0 commit comments