feat: усилить reconciler для lab4

This commit is contained in:
2026-11-05 23:30:24 +03:00
parent a3bbdeef42
commit 1ad44408ba
11 changed files with 276 additions and 54 deletions
+11
View File
@@ -102,6 +102,17 @@ class S3Storage:
self._translate(error)
return ObjectStream(response)
async def exists(self, key: str) -> bool:
try:
await asyncio.to_thread(self._client.stat_object, self.bucket, key)
return True
except Exception as error:
try:
self._translate(error)
except FileNotFoundError:
return False
raise
async def remove(self, key: str) -> None:
try:
await asyncio.to_thread(self._client.remove_object, self.bucket, key)