Index: src/config/database.js
===================================================================
--- src/config/database.js	(revision f1956d7c01134c1d4e87af110af984c14a84d8b0)
+++ src/config/database.js	(revision 7b0703526cef42176d0c46db5f65acae0b4064cf)
@@ -17,4 +17,8 @@
 db.pragma('journal_mode = WAL');
 db.pragma('foreign_keys = ON');
+// With WAL + several concurrent writers (request handlers, the delivery worker, the
+// background thread-crawler) a short write-lock should retry rather than throw SQLITE_BUSY.
+db.pragma('busy_timeout = 5000');   // wait up to 5s for a lock instead of failing immediately
+db.pragma('synchronous = NORMAL');  // safe with WAL (no torn writes); fewer fsyncs = faster writes
 
 export function initializeDatabase() {
