update to correct error

This commit is contained in:
stvnrlly
2023-08-31 10:57:54 -04:00
parent bf33ed7173
commit 7bbb05059c
6 changed files with 20 additions and 16 deletions

View File

@@ -81,7 +81,7 @@ def persist_notification(
reply_to_text=None,
billable_units=None,
document_download_count=None,
updated_at=None
updated_at=None,
):
current_app.logger.info("Persisting notification")

View File

@@ -46,7 +46,7 @@ def check_service_over_api_rate_limit(service, api_key):
def check_service_over_total_message_limit(key_type, service):
if key_type == KEY_TYPE_TEST or not current_app.config['REDIS_ENABLED']:
if key_type == KEY_TYPE_TEST or not current_app.config["REDIS_ENABLED"]:
return 0
cache_key = total_limit_cache_key(service.id)
@@ -59,9 +59,10 @@ def check_service_over_total_message_limit(key_type, service):
if int(service_stats) >= service.total_message_limit:
current_app.logger.warning(
"service {} has been rate limited for total use sent {} limit {}".format(
service.id, int(service_stats), service.total_message_limit)
service.id, int(service_stats), service.total_message_limit
)
)
raise TooManyRequestsError(service.total_message_limit)
raise TotalRequestsError(service.total_message_limit)
return int(service_stats)