fix batch processing

This commit is contained in:
Kenneth Kehl
2024-12-16 14:33:50 -08:00
parent 87d9ae5f33
commit 6316e266ee
2 changed files with 4 additions and 5 deletions

View File

@@ -244,4 +244,7 @@ def process_delivery_receipts():
start_time = utc_now() - timedelta(minutes=10)
end_time = utc_now()
receipts = cloudwatch.check_delivery_receipts(start_time, end_time)
dao_update_delivery_receipts(receipts)
batch_size = 100
for i in range(0, len(receipts), batch_size):
batch = receipts[i : i + batch_size]
dao_update_delivery_receipts(batch)

View File

@@ -69,10 +69,6 @@ class AwsCloudwatchClient(Client):
def check_delivery_receipts(self, start, end):
result = self._client.describe_log_groups()
print(result)
return
region = cloud_config.sns_region
account_number = self._extract_account_number(cloud_config.ses_domain_arn)