Skip to content

Commit

Permalink
Merge pull request #7 from FloRul/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
FloRul authored Jan 27, 2024
2 parents 5c7fdf6 + 1afe7ed commit 9c9a62b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ingestion/src/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def delete_documents(filename: str):

def fetch_file(bucket, key):
s3 = boto3.client("s3")
local_filename = f"/tmp/{key}"
local_filename = f"/tmp/{key.split('/')[-1]}"

try:
s3.download_file(bucket, key, local_filename)
Expand Down Expand Up @@ -145,7 +145,7 @@ def lambda_handler(event, context):
return len(docs)

elif eventName.startswith(OBJECT_REMOVED):
return delete_documents(filename=key)
return delete_documents(filename=key.split("/")[-1])

except Exception as e:
print(e)
Expand Down

0 comments on commit 9c9a62b

Please sign in to comment.