Most-overdue-first scheduling + rich timeout diagnostics #36
Reference in New Issue
Block a user
Delete Branch "dev"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
77f7a23Order due sources bylast_checked_at ASC NULLS FIRST, idinselect_due_sources. Combined with Celery's FIFOdownloadqueue, the most-overdue source in each tick hits a worker first — closes the "freshly-rerun source keeps cutting in line ahead of a still-waiting one" anti-starvation gap when queue throughput is below the tick population.99b66aaPreserve gallery-dl's partial output on timeout. TheTimeoutExpiredbranch was returning an emptyDownloadResult(no stdout/stderr/file count, generic "timed out after N seconds" message). Now capturese.stdout/e.stderr(whatever gallery-dl produced before being killed), counts files written so far, surfaces a stderr tail-hint in the error message, and promotes toRATE_LIMITEDif the partial stderr matches rate-limit patterns — so a rate-limit-induced timeout triggers the platform cooldown the same way a clean-exit rate limit does.No alembic migrations, no schema changes, no new env vars.
Test plan
After
:latestrebuilds and compose restarts:files_count > 0if gallery-dl wrote anything before being killed; error summary readsDownload timed out after 900s — N file(s) written; last stderr: <tail line>instead of the prior generic message.error_type: rate_limitedand stamps the platform cooldown (visible at/api/system/activity/summary→scheduler.platform_cooldowns).last_checked_at(or NULL) reach workers ahead of freshly-checked ones; no source can be starved indefinitely.🤖 Generated with Claude Code