feat: Add image, update VS Code launch configuration, and enhance gitignore rules for build artifacts.

This commit is contained in:
xds
2026-02-12 14:02:36 +03:00
parent 456562ec1d
commit c6142715d9
31 changed files with 85 additions and 51 deletions

View File

@@ -56,6 +56,21 @@ class S3Adapter:
print(f"Error downloading from S3: {e}")
return None
async def stream_file(self, object_name: str, chunk_size: int = 65536):
"""Streams a file from S3 yielding chunks. Memory-efficient for large files."""
try:
async with self._get_client() as client:
response = await client.get_object(Bucket=self.bucket_name, Key=object_name)
async with response['Body'] as stream:
while True:
chunk = await stream.read(chunk_size)
if not chunk:
break
yield chunk
except ClientError as e:
print(f"Error streaming from S3: {e}")
return
async def delete_file(self, object_name: str):
"""Deletes a file from S3."""
try: