mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-20 15:31:15 -05:00
Added process for dvla acknowledgement file
Daily schedule task to check ack file against zip file lists if we haven't receive ack for a zip file, raise a 500 exception
This commit is contained in:
@@ -107,3 +107,19 @@ def upload_letters_pdf(reference, crown, filedata):
|
||||
|
||||
current_app.logger.info("Uploading letters PDF {} to {}".format(
|
||||
upload_file_name, current_app.config['LETTERS_PDF_BUCKET_NAME']))
|
||||
|
||||
|
||||
def get_list_of_files_by_suffix(bucket_name, subfolder='', suffix=''):
|
||||
s3_client = client('s3', current_app.config['AWS_REGION'])
|
||||
paginator = s3_client.get_paginator('list_objects_v2')
|
||||
|
||||
page_iterator = paginator.paginate(
|
||||
Bucket=bucket_name,
|
||||
Prefix=subfolder
|
||||
)
|
||||
|
||||
for page in page_iterator:
|
||||
for obj in page['Contents']:
|
||||
key = obj['Key']
|
||||
if key.endswith(suffix):
|
||||
yield key
|
||||
|
||||
Reference in New Issue
Block a user