mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 01:41:05 -05:00
code review feedback
This commit is contained in:
@@ -36,7 +36,7 @@ def list_s3_objects():
|
|||||||
response = s3.list_objects_v2(Bucket=bucket_name)
|
response = s3.list_objects_v2(Bucket=bucket_name)
|
||||||
while True:
|
while True:
|
||||||
for obj in response.get("Contents", []):
|
for obj in response.get("Contents", []):
|
||||||
objects.append(obj["Key"])
|
yield obj["Key"]
|
||||||
if "NextContinuationToken" in response:
|
if "NextContinuationToken" in response:
|
||||||
response = s3.list_objects_v2(
|
response = s3.list_objects_v2(
|
||||||
Bucket=bucket_name,
|
Bucket=bucket_name,
|
||||||
@@ -48,7 +48,7 @@ def list_s3_objects():
|
|||||||
current_app.logger.error(
|
current_app.logger.error(
|
||||||
f"An error occurred while regenerating cache #notify-admin-1200 {e}"
|
f"An error occurred while regenerating cache #notify-admin-1200 {e}"
|
||||||
)
|
)
|
||||||
return objects
|
|
||||||
|
|
||||||
|
|
||||||
def get_s3_files():
|
def get_s3_files():
|
||||||
|
|||||||
Reference in New Issue
Block a user