add log statement when our send quota is used up

This commit is contained in:
Kenneth Kehl
2025-09-29 12:02:13 -07:00
parent 57fdbd690c
commit 16e93011ef

View File

@@ -7,6 +7,7 @@ from flask import current_app
from app.clients import AWS_CLIENT_CONFIG, Client
from app.cloudfoundry_config import cloud_config
from app.utils import hilite
class AwsCloudwatchClient(Client):
@@ -179,6 +180,13 @@ class AwsCloudwatchClient(Client):
failed_event_set = self._get_receipts(log_group_name, start, end)
current_app.logger.info((f"Failed message count: {len(failed_event_set)}"))
for failure in failed_event_set:
failure = json.loads(failure)
if "No quota left for account" == failure["delivery.providerResponse"]:
current_app.logger.warning(
hilite("**********NO QUOTA LEFT TO SEND MESSAGES!!!**********")
)
return delivered_event_set, failed_event_set
def _get_receipts(self, log_group_name, start, end):