Skip to content

Commit 392ec7f

Browse files
7418claude
andcommitted
fix: SQLite busy_timeout prevents 'database is locked' during parallel build
Next.js uses multiple workers for prerendering, all hitting the same SQLite DB file. WAL mode allows concurrent reads but writes still lock. Added busy_timeout=5000 so workers wait up to 5s instead of failing immediately with 'database is locked'. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 6781cb6 commit 392ec7f

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/lib/db.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ export function getDb(): Database.Database {
5151

5252
db = new Database(DB_PATH);
5353
db.pragma('journal_mode = WAL');
54+
db.pragma('busy_timeout = 5000');
5455
db.pragma('foreign_keys = ON');
5556
initDb(db);
5657
}

0 commit comments

Comments
 (0)