Skip to content

Commit

Permalink
Merge pull request #61 from PrivateAIM/59-upload-file-chunk
Browse files Browse the repository at this point in the history
Use spooled upload files for submitting results to hub
  • Loading branch information
mjugl authored Oct 18, 2024
2 parents 815a56a + 5921321 commit e9f248b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion project/hub.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import time
import typing
import urllib.parse
from datetime import datetime
from io import BytesIO
Expand Down Expand Up @@ -595,7 +596,7 @@ def upload_to_bucket(
self,
bucket_id: str | UUID,
file_name: str,
file: bytes | BytesIO,
file: typing.IO[bytes],
content_type: str = "application/octet-stream",
) -> ResourceList[BucketFile]:
"""
Expand Down
2 changes: 1 addition & 1 deletion project/routers/final.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ async def submit_final_result_to_hub(
bucket_file_lst = storage_client.upload_to_bucket(
analysis_bucket.external_id,
file.filename,
await file.read(), # TODO should be chunked as well
file.file,
file.content_type or "application/octet-stream",
)

Expand Down
2 changes: 1 addition & 1 deletion project/routers/intermediate.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ async def submit_intermediate_result_to_hub(
bucket_file_lst = storage_client.upload_to_bucket(
analysis_bucket.external_id,
file.filename,
await file.read(), # TODO should be chunked for large files
file.file,
file.content_type or "application/octet-stream",
)

Expand Down

0 comments on commit e9f248b

Please sign in to comment.