fix(db): add busy_timeout to prevent SQLite database busy errors

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.
This commit is contained in:
Amadeus Mader 2026-03-07 18:49:34 +01:00
parent 75c792dd32
commit 46a1500aed
2 changed files with 5 additions and 2 deletions

View file

@ -73,7 +73,7 @@ SELECT source_id, metadata_filepath, fanart_filepath, poster_filepath, banner_fi
- tvshow.nfo
```
## Issue 4: SQLite "Database busy" errors blocking job processing
## Issue 4: SQLite "Database busy" errors blocking job processing [COMPLETED]
**Problem:** The Oban job queue can get stuck with "Database busy" errors, preventing all indexing and download jobs from processing. This occurs when:

View file

@ -32,7 +32,10 @@ config :pinchflat,
config :pinchflat, Pinchflat.Repo,
journal_mode: :wal,
pool_size: 5
pool_size: 5,
# Set busy_timeout to 5 seconds to prevent "Database busy" errors during concurrent operations.
# Without this, queries fail immediately when the database is locked instead of waiting.
busy_timeout: 5000
# Configures the endpoint
config :pinchflat, PinchflatWeb.Endpoint,