Skip to content

Commit

Permalink
Ignored uploads/tmp as this is where images get transformed
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesspeake committed Jun 17, 2024
1 parent 346ed8f commit 1fe6436
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,12 @@ def sns_scan_results(
},
)

def ignore_file(key):
if key.startswith('uploads/tmp'):
print("Ignoring path and exiting: %s\n" % (key))
return True
else:
return False

def lambda_handler(event, context):
s3 = boto3.resource("s3", endpoint_url=S3_ENDPOINT)
Expand All @@ -211,6 +217,9 @@ def lambda_handler(event, context):
print("Script starting at %s\n" % (start_time))
s3_object = event_object(event, event_source=EVENT_SOURCE)

if ignore_file(s3_object.key):
return

if str_to_bool(AV_PROCESS_ORIGINAL_VERSION_ONLY):
verify_s3_object_version(s3, s3_object)

Expand Down

0 comments on commit 1fe6436

Please sign in to comment.