Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Releases: alexgenovese/docker-pruna

Async Download

19 Aug 14:24

Choose a tag to compare

Added an in-memory background task system for Async Download*:

New endpoints:

  • POST /download — enqueues a download job and returns 202 with task_id and status_url.
  • GET /tasks/<task_id> — check status/result of the download task.

Worker thread runs dl_mod.download_model(...) and updates task status (queued → running → finished/error).
This avoids keeping the HTTP request open during long downloads (which can lead to 524 timeouts from reverse proxies).

Why this should help

524 (A Cloudflare-specific code) indicates a timeout between the edge and the origin request; long-running downloads can exceed the HTTP request lifetime. Moving heavy operations to background tasks ensures the HTTP response returns quickly and the server continues work asynchronously.