3 ms·
It sometimes takes minutes for the file to become available. Meanwhile we get a 401 unauthorized. Even though we have something in place like that: def is_fi
by biermic 5y ago
It sometimes takes minutes for the file to become available. Meanwhile we get a 401 unauthorized. Even though we have something in place like that:
def is_file_uploaded(file_name, request_id):
for i in range(S3_UPLOAD_ATTEMPTS_COUNT):
try:
s3.Object(BUCKET, file_name).load()
return True
except botocore.exceptions.ClientError as e:
logger.warning('File still not uploaded to S3.
Check - {}/{} (request_id - {})'.format(
i+1, S3_UPLOAD_ATTEMPTS_COUNT, request_id
))
return False