notify-162 delete incomplete s3 uploads (#276)

Co-authored-by: Kenneth Kehl <@kkehl@flexion.us>
This commit is contained in:
Kenneth Kehl
2023-05-23 08:31:30 -07:00
committed by GitHub
parent 49a73a2238
commit 6f6061455c
6 changed files with 59 additions and 1 deletions

View File

@@ -65,3 +65,14 @@ def remove_job_from_s3(service_id, job_id):
def remove_s3_object(bucket_name, object_key, access_key, secret_key, region):
obj = get_s3_object(bucket_name, object_key, access_key, secret_key, region)
return obj.delete()
def remove_csv_object(object_key):
obj = get_s3_object(
current_app.config['CSV_UPLOAD_BUCKET']['bucket'],
object_key,
current_app.config['CSV_UPLOAD_BUCKET']['access_key_id'],
current_app.config['CSV_UPLOAD_BUCKET']['secret_access_key'],
current_app.config['CSV_UPLOAD_BUCKET']['region']
)
return obj.delete()