feat(web): iPhone PWA fixes (M1) + warm RTO redesign (M2) #3
@@ -131,6 +131,11 @@ def _connection() -> sqlite3.Connection:
|
||||
# alongside the web server without tripping "database is locked".
|
||||
_conn.execute("PRAGMA busy_timeout=5000")
|
||||
_conn.execute("PRAGMA journal_mode=WAL")
|
||||
# WAL's recommended companion: don't fsync on every commit (only at
|
||||
# checkpoint). Safe against app crashes; a power/OS crash can lose the last
|
||||
# txn but never corrupt. On disk-backed storage this turns ~0.15s-per-commit
|
||||
# fsync latency into ~nothing — big win for per-turn writes + the dream loop.
|
||||
_conn.execute("PRAGMA synchronous=NORMAL")
|
||||
_conn.executescript(SCHEMA)
|
||||
# Migrations for DBs created before a column existed (no-op if present).
|
||||
for ddl in ("ALTER TABLE sessions ADD COLUMN mode TEXT",):
|
||||
|
||||
Reference in New Issue
Block a user