mirror of
https://github.com/saltbo/zpan.git
synced 2026-09-01 15:49:00 +08:00
b959e5e6bf
Three related changes hardening the remote downloader, bundled because the module-path rename touches every file — splitting would leave a mid-history commit that doesn't build. Engine supervision: a managed engine subprocess (aria2c / qbittorrent-nox) that exits unexpectedly now crashes the worker. watchEngineProcess waits on the child, logs the exit at error level, and cancels the run context so `downloader up` returns non-zero; the container (restart: unless-stopped) then restarts the whole stack. Previously the exit error was discarded and the worker kept heartbeating as healthy while every task failed against the dead RPC. A deliberate shutdown kill is told apart from a crash via a stopping flag. aria2 GID recovery: waitAria2 re-discovers the live GID via findTask when aria2 reports 'GID ... is not found' mid-download (e.g. after an aria2 restart) instead of failing the task. Adds isAria2GIDNotFound, which matches tellStatus's message format that isAria2DownloadNotFound missed. CLI install: move the entrypoint to the module root (cmd/main.go) and rename the module github.com/saltbo/zpan/cmd -> github.com/saltbo/zpan so `go install .` from cmd/ yields a zpan binary. Internal imports shorten to github.com/saltbo/zpan/internal/...; the Dockerfile builds the module root. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>