Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosribas committed Jul 17, 2024
1 parent fded319 commit a0d7f37
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,10 @@ def download_file(task_id: str, data_type: str):
raise HTTPException(status_code=202, detail="Task is still processing")


def stream_file(file_path: str, filename: str):
async def stream_file(file_path: str, filename: str):
async def read_file():
async with aiofiles.open(file_path, "rb") as file:
while chunk := file.read(16384): # Read in 16KB chunks
while chunk := await file.read(16384): # Read in 16KB chunks
yield chunk

file_size = os.path.getsize(file_path)
Expand Down

0 comments on commit a0d7f37

Please sign in to comment.