Skip to content

Commit

Permalink
Use head_object to check for object existence
Browse files Browse the repository at this point in the history
  • Loading branch information
gitcarbs committed Aug 23, 2024
1 parent 68c991c commit fafa44a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
5.0.11 (unreleased)
5.0.12
-------------------

- Nothing changed yet.
- Use head_object to check for object existence


5.0.10 (2022-05-21)
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.0.11.dev0
5.0.12.dev0
2 changes: 1 addition & 1 deletion guillotina_s3storage/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ async def exists(self):
util = get_utility(IS3BlobStore)
try:
async with util.s3_client() as client:
return await client.get_object(Bucket=bucket, Key=uri) is not None
return await client.head_object(Bucket=bucket, Key=uri) is not None
except botocore.exceptions.ClientError as ex:
if ex.response["Error"]["Code"] == "NoSuchKey":
return False
Expand Down

0 comments on commit fafa44a

Please sign in to comment.