Add rescue block to SourceDeletionWorker to handle cases where the
source no longer exists. This prevents infinite retries when a deletion
job fails and the source has already been removed from the database.
Configure SQLite busy_timeout PRAGMA to 5000ms so queries wait for
locks to be released instead of failing immediately. This prevents
Oban job queue from getting stuck with 'Database busy' errors during
concurrent operations.
Include :executing in the unique states list for both FastIndexingWorker
and MediaCollectionIndexingWorker. This ensures Oban properly tracks
executing jobs and prevents potential duplicate job issues.
Without :executing in the unique states, the uniqueness check doesn't
consider currently running jobs, which could lead to jobs not appearing
in the UI's active tasks view or duplicate jobs being scheduled.
After each successful indexing run, the source's download_cutoff_date is
automatically advanced to 7 days ago if the current cutoff date is older
(or nil). This prevents yt-dlp from scanning through months of old videos
on every index run, significantly improving indexing performance for
channels with large backlogs.
The 7-day buffer ensures recent videos are still checked on subsequent
index runs while keeping indexing fast (minutes instead of hours).
Also updates AGENTS.md to document Docker-based development workflow
and adds Pinchflat_improvements.md for tracking known issues.