fix: persist multipart uploads as durable jobs

This commit is contained in:
hailt 2026-11-12 23:09:54 +07:00
parent aa9638f6b3
commit 9dd5f386ce
6 changed files with 54 additions and 2 deletions

View file

@ -126,6 +126,12 @@ def abort_multipart(key: str, upload_id: str) -> None:
pass
def list_multipart_parts(key: str, upload_id: str) -> list[dict]:
s = get_settings()
response = _client().list_parts(Bucket=s.r2_bucket, Key=key, UploadId=upload_id)
return response.get("Parts", [])
def download_to_file(key: str, dest_path: str, chunk_bytes: int = 8 * 1024 * 1024) -> int:
"""Stream an object to disk (GB-scale safe, bounded RAM). Returns bytes."""
s = get_settings()