Skip to content
Open
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
2 changes: 2 additions & 0 deletions backend/app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,8 @@ async def download_to_path(
try:
with open(dest_path, "wb") as f:
async for chunk in r.aiter_bytes(chunk_size=chunk_size):
if cancel_event and cancel_event.is_set():
raise asyncio.CancelledError("Download cancelled by user")
bytes_received += len(chunk)
if bytes_received > MAX_UPLOAD_SIZE:
raise HTTPException(
Expand Down
Loading