closes the real gap: a restart kills the yt-dlp worker threads but leaves their rows at 'downloading', which the pump counts as busy -> the queue wedges and they never finish. track live worker dl_ids in _active_worker_ids (added at worker start, dropped in finally). requeue_orphaned_youtube() puts any 'downloading' youtube row with no live worker back to 'queued' so the pump re-runs it. after a restart the set is empty, so all stuck rows recover; during normal operation active ones are protected (no false positives, no timestamp guessing). the hourly drain calls it before pumping + logs the count. seam-tested. |
||
|---|---|---|
| .. | ||
| handlers | ||
| __init__.py | ||
| api.py | ||
| blocks.py | ||
| deps.py | ||
| progress.py | ||
| schedule.py | ||
| signals.py | ||