Fixed
- Database connection starvation under load: Background services could block API responses
- Changed SQLite connection pool from
MaxOpenConns(1)toMaxOpenConns(10)for WAL mode concurrency - SQLite WAL mode safely supports multiple concurrent readers with one writer
- Changed SQLite connection pool from
- Context deadlines in background services: All database queries now have proper timeouts
- Added 10-30 second context timeouts to scanner, verifier, notifier, and recovery services
- Prevents individual slow queries from blocking the entire application
- Uses exponential backoff retry for SQLITE_BUSY errors
- Removed dead code: Cleaned up unused
filepath.Clean()call in health checker
Added
- Database performance index: New migration adds optimized index for file_path lookups
- Expression-based index on
json_extract(event_data, '$.file_path')for efficient lookups - Compound index on
(event_type, file_path)for common query patterns - Significantly improves corruption lookup performance on large databases
- Expression-based index on