Noreposts Feed

Enable SQLite WAL mode for better concurrency

- Enable WAL (Write-Ahead Logging) mode to allow concurrent reads/writes
- Set busy_timeout to 5 seconds to reduce lock errors
- This fixes database lock issues caused by backfill competing with Jetstream

+11
+11
src/database.rs
··· 11 11 impl Database { 12 12 pub async fn new(database_url: &str) -> Result<Self> { 13 13 let pool = SqlitePool::connect(database_url).await?; 14 + 15 + // Enable WAL mode for better concurrency 16 + sqlx::query("PRAGMA journal_mode=WAL;") 17 + .execute(&pool) 18 + .await?; 19 + 20 + // Set busy timeout to 5 seconds 21 + sqlx::query("PRAGMA busy_timeout=5000;") 22 + .execute(&pool) 23 + .await?; 24 + 14 25 Ok(Self { pool }) 15 26 } 16 27