Skip to content

Commit

Permalink
use updated function
Browse files Browse the repository at this point in the history
  • Loading branch information
ychiucco committed Aug 22, 2024
1 parent 82e5fcf commit 152f7a4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
3 changes: 1 addition & 2 deletions fractal_server/app/routes/admin/v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,9 +387,8 @@ async def download_job_logs(
# Create and return byte stream for zipped log folder
PREFIX_ZIP = Path(job.working_dir).name
zip_filename = f"{PREFIX_ZIP}_archive.zip"
byte_stream = _zip_folder_to_byte_stream(folder=job.working_dir)
return StreamingResponse(
iter([byte_stream.getvalue()]),
_zip_folder_to_byte_stream(folder=job.working_dir),
media_type="application/x-zip-compressed",
headers={"Content-Disposition": f"attachment;filename={zip_filename}"},
)
3 changes: 1 addition & 2 deletions fractal_server/app/routes/admin/v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,8 @@ async def download_job_logs(
# Create and return byte stream for zipped log folder
PREFIX_ZIP = Path(job.working_dir).name
zip_filename = f"{PREFIX_ZIP}_archive.zip"
byte_stream = _zip_folder_to_byte_stream(folder=job.working_dir)
return StreamingResponse(
iter([byte_stream.getvalue()]),
_zip_folder_to_byte_stream(folder=job.working_dir),
media_type="application/x-zip-compressed",
headers={"Content-Disposition": f"attachment;filename={zip_filename}"},
)
Expand Down
3 changes: 1 addition & 2 deletions fractal_server/app/routes/api/v1/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,8 @@ async def download_job_logs(
# Create and return byte stream for zipped log folder
PREFIX_ZIP = Path(job.working_dir).name
zip_filename = f"{PREFIX_ZIP}_archive.zip"
byte_stream = _zip_folder_to_byte_stream(folder=job.working_dir)
return StreamingResponse(
iter([byte_stream.getvalue()]),
_zip_folder_to_byte_stream(folder=job.working_dir),
media_type="application/x-zip-compressed",
headers={"Content-Disposition": f"attachment;filename={zip_filename}"},
)
Expand Down

0 comments on commit 152f7a4

Please sign in to comment.