mirror of
https://github.com/rzuasti/oott.git
synced 2026-07-08 19:21:54 +02:00
Enabling WAL per pooled connection raced several concurrent journal-mode switches when r2d2 eagerly opens the pool at startup, producing transient "disk I/O error" and "database is locked" failures. WAL is a persistent property of the database file, so enable it once in init_db (before the scanners and web server start) and keep only the genuinely per-connection pragmas (busy_timeout, synchronous, foreign_keys) in the pool initializer. Also remove the -wal/-shm sidecars in run.sh: deleting oott.db but leaving a stale write-ahead log behind makes SQLite open the fresh database against an orphaned log and fail with "disk I/O error". Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
7 lines
353 B
Bash
Executable File
7 lines
353 B
Bash
Executable File
#!/bin/sh
|
|
# Remove the database and its WAL sidecars. Deleting oott.db but leaving a stale -wal/-shm
|
|
# behind (e.g. from a previous run killed before a checkpoint) makes SQLite open the fresh
|
|
# database against an orphaned write-ahead log and fail with "disk I/O error".
|
|
sudo rm -f oott.db oott.db-wal oott.db-shm
|
|
sudo CARGO_HOME=$HOME/.cargo cargo run
|