Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/blaxel/core/sandbox/default/filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# Multipart upload constants
MULTIPART_THRESHOLD = 5 * 1024 * 1024 # 5MB
CHUNK_SIZE = 5 * 1024 * 1024 # 5MB per part
MAX_PARALLEL_UPLOADS = 20 # Number of parallel part uploads
MAX_PARALLEL_UPLOADS = 3 # Number of parallel part uploads

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -480,8 +480,8 @@ async def _initiate_multipart_upload(
client = self.get_client()
response = await client.post(url, json=body, headers=headers)
try:
data = json.loads(await response.aread())
self.handle_response_error(response)
data = json.loads(await response.aread())
return data
finally:
await response.aclose()
Expand All @@ -498,9 +498,9 @@ async def _upload_part(self, upload_id: str, part_number: int, data: bytes) -> D
client = self.get_client()
response = await client.put(url, files=files, params=params, headers=headers)
try:
data = json.loads(await response.aread())
self.handle_response_error(response)
return data
result = json.loads(await response.aread())
return result
finally:
await response.aclose()

Expand All @@ -515,8 +515,8 @@ async def _complete_multipart_upload(
client = self.get_client()
response = await client.post(url, json=body, headers=headers)
try:
data = json.loads(await response.aread())
self.handle_response_error(response)
data = json.loads(await response.aread())
return SuccessResponse.from_dict(data)
finally:
await response.aclose()
Expand All @@ -531,7 +531,7 @@ async def _abort_multipart_upload(self, upload_id: str) -> None:
try:
# Don't raise error if abort fails - we want to throw the original error
if not response.is_success:
print(f"Warning: Failed to abort multipart upload: {response.status_code}")
logger.warning(f"Failed to abort multipart upload: {response.status_code}")
finally:
await response.aclose()

Expand Down
2 changes: 1 addition & 1 deletion src/blaxel/core/sandbox/sync/filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
# Multipart upload constants
MULTIPART_THRESHOLD = 5 * 1024 * 1024 # 5MB
CHUNK_SIZE = 5 * 1024 * 1024 # 5MB per part
MAX_PARALLEL_UPLOADS = 20 # Number of parallel part uploads
MAX_PARALLEL_UPLOADS = 3 # Number of parallel part uploads


class SyncSandboxFileSystem(SyncSandboxAction):
Expand Down
Loading