Skip to content

Commit

Permalink
Fix some cache problems
Browse files Browse the repository at this point in the history
  • Loading branch information
tomchop committed Mar 31, 2024
1 parent c54fedb commit 62e6a6f
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions core/web/apiv2/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,13 @@ async def patch_export(request: PatchExportRequest) -> ExportTask:
return new


@router.get("/export/{export_name}/content")
async def export_content(export_name: str):
@router.get("/export/{export_id}/content")
async def export_content(export_id: str):
"""Downloads the latest contents of a given ExportTask."""
export = ExportTask.find(name=export_name)
export = ExportTask.get(export_id)
if not export:
raise HTTPException(
status_code=404, detail=f"ExportTask {export_name} not found"
)
return FileResponse(export.output_file)
raise HTTPException(status_code=404, detail=f"ExportTask {export_id} not found")
return FileResponse(export.output_file, headers={"Cache-Control": "no-cache"})


@router.delete("/export/{export_name}")
Expand Down

0 comments on commit 62e6a6f

Please sign in to comment.