mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-19 05:59:44 -04:00
To check the daily limit get the daily notification_count from redis.
The daily limit cache is set by the api when a notification is created. There is one cache key per service per day and it expires after 24 hours.
This commit is contained in:
@@ -612,8 +612,8 @@ def _check_messages(service_id, template_id, upload_id, preview_row, letters_as_
|
||||
if e.status_code != 404:
|
||||
raise
|
||||
|
||||
statistics = service_api_client.get_service_statistics(service_id, today_only=True)
|
||||
remaining_messages = (current_service.message_limit - sum(stat['requested'] for stat in statistics.values()))
|
||||
notification_count = service_api_client.get_notification_count(service_id)
|
||||
remaining_messages = (current_service.message_limit - notification_count)
|
||||
|
||||
contents = s3download(service_id, upload_id)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user