mirror of
https://github.com/saltbo/zpan.git
synced 2026-09-19 10:01:12 +08:00
Second restart bug behind the same stuck Moonfall: aria2 auto-seeds a torrent the instant its download finishes (--seed-time), so a completed-but-not-yet- uploaded download shows up in ListSeeds. reconcileEngineSeeds runs at startup BEFORE the task loop marks tasks running, so 'running' was empty and it adopted that seed as a done seed for managed expiry — skipping the upload entirely. The task then sat at 'downloading' forever and the file would be deleted when the seed expired. Skip seeds whose task is still assigned/unfinished (AssignedTasks: assigned/ downloading/interrupted/uploading) — those belong to the task loop, which will upload then seed them. Only genuinely orphaned seeds (completed tasks) are adopted. Confirmed on prod: Moonfall finished (7.4GB on disk) with result_object_id=null, stuck downloading.