From 62e0aa65beb1ecf35374feb8529e3f9ad91937ce Mon Sep 17 00:00:00 2001 From: Nathan Zimmerman Date: Mon, 7 Nov 2022 11:26:09 -0600 Subject: [PATCH] Remove testing code --- lambdas/s3-discovery/handler.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/lambdas/s3-discovery/handler.py b/lambdas/s3-discovery/handler.py index 9d4c2691..dee8cac5 100644 --- a/lambdas/s3-discovery/handler.py +++ b/lambdas/s3-discovery/handler.py @@ -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 @@ -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