Skip to content
This repository has been archived by the owner on Sep 26, 2023. It is now read-only.

Commit

Permalink
Remove testing code
Browse files Browse the repository at this point in the history
  • Loading branch information
moradology committed Nov 7, 2022
1 parent 830406a commit 62e0aa6
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions lambdas/s3-discovery/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,12 @@ def handler(event, context):

file_objs_size = 0
payload = {**event, "cogify": cogify, "objects": []}
CONTINUE = False
for page in pages:
for obj in page["Contents"]:
# For testing, remove before PR accepted
if CONTINUE:
# The limit is advertised at 256000, but we'll preserve some breathing room
if file_objs_size > 230000:
payload["start_after"] = start_after
break
# The limit is advertised at 256000, but we'll preserve some breathing room
# if file_objs_size > 230000:
# payload["start_after"] = start_after
# break
filename = obj["Key"]
if filename_regex and not re.match(filename_regex, filename):
continue
Expand All @@ -63,7 +58,6 @@ def handler(event, context):
file_obj_size = len(json.dumps(file_obj, ensure_ascii=False).encode("utf8"))
file_objs_size = file_objs_size + file_obj_size
start_after = filename
CONTINUE = True
return payload


Expand Down

0 comments on commit 62e0aa6

Please sign in to comment.