mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-02 09:26:08 -05:00
cleanup
This commit is contained in:
@@ -317,10 +317,16 @@ def get_job_from_s3(service_id, job_id):
|
|||||||
|
|
||||||
while retries < max_retries:
|
while retries < max_retries:
|
||||||
|
|
||||||
|
try:
|
||||||
|
# TODO
|
||||||
|
# for transition on optimizing the s3 partition, we have
|
||||||
|
# to check for the file location using the new way and the
|
||||||
|
# old way. After this has been on production for a few weeks
|
||||||
|
# we should remove the check for the old way.
|
||||||
try:
|
try:
|
||||||
obj = get_s3_object(*get_job_location(service_id, job_id))
|
obj = get_s3_object(*get_job_location(service_id, job_id))
|
||||||
# TODO remove this when we have fully transitioned to the NEW_FILE_LOCATION_STRUCTURE
|
return obj.get()["Body"].read().decode("utf-8")
|
||||||
if obj is None:
|
except botocore.exceptions.ClientError:
|
||||||
obj = get_s3_object(*get_old_job_location(service_id, job_id))
|
obj = get_s3_object(*get_old_job_location(service_id, job_id))
|
||||||
return obj.get()["Body"].read().decode("utf-8")
|
return obj.get()["Body"].read().decode("utf-8")
|
||||||
except botocore.exceptions.ClientError as e:
|
except botocore.exceptions.ClientError as e:
|
||||||
|
|||||||
Reference in New Issue
Block a user