format
All checks were successful
CI / ci (pull_request) Successful in 21s

This commit is contained in:
Anibal Angulo
2026-03-09 07:35:06 +00:00
parent ad7a94fc14
commit 9ce472f2ca

View File

@@ -16,9 +16,7 @@ logger = logging.getLogger(__name__)
class NotificationBackend(Protocol): class NotificationBackend(Protocol):
"""Backend-agnostic interface for notification storage.""" """Backend-agnostic interface for notification storage."""
async def get_recent_notifications( async def get_recent_notifications(self, phone_number: str) -> list[dict[str, Any]]:
self, phone_number: str
) -> list[dict[str, Any]]:
"""Return recent notifications for *phone_number*.""" """Return recent notifications for *phone_number*."""
... ...
@@ -51,9 +49,7 @@ class FirestoreNotificationBackend:
self._max_to_notify = max_to_notify self._max_to_notify = max_to_notify
self._window_hours = window_hours self._window_hours = window_hours
async def get_recent_notifications( async def get_recent_notifications(self, phone_number: str) -> list[dict[str, Any]]:
self, phone_number: str
) -> list[dict[str, Any]]:
"""Get recent notifications for a user. """Get recent notifications for a user.
Retrieves notifications created within the configured time window, Retrieves notifications created within the configured time window,
@@ -159,9 +155,7 @@ class RedisNotificationBackend:
self._max_to_notify = max_to_notify self._max_to_notify = max_to_notify
self._window_hours = window_hours self._window_hours = window_hours
async def get_recent_notifications( async def get_recent_notifications(self, phone_number: str) -> list[dict[str, Any]]:
self, phone_number: str
) -> list[dict[str, Any]]:
"""Get recent notifications for a user from Redis. """Get recent notifications for a user from Redis.
Reads from the ``notification:{phone}`` key, parses the JSON Reads from the ``notification:{phone}`` key, parses the JSON