diff --git a/.gitignore b/.gitignore index ee58279..c4c7ddc 100644 --- a/.gitignore +++ b/.gitignore @@ -21,4 +21,5 @@ Thumbs.db # SQLite runtime files / local recovery backups *.db-wal *.db-shm +*.db.bak-* db-backups/ diff --git a/matching.db b/matching.db index 63c8d48..30d7817 100644 Binary files a/matching.db and b/matching.db differ diff --git a/mysql_preview_server.py b/mysql_preview_server.py index 96c6583..5d1256e 100644 --- a/mysql_preview_server.py +++ b/mysql_preview_server.py @@ -56,8 +56,11 @@ DB_WRITE_LOCK = threading.Lock() def configure_sqlite_connection(conn): - conn.execute('PRAGMA journal_mode=WAL') - conn.execute('PRAGMA synchronous=NORMAL') + # Docker에서 8091/8092가 같은 SQLite 파일을 bind mount로 공유한다. + # WAL/SHM 파일이 남은 상태에서 컨테이너 재시작/복구가 섞이면 malformed가 반복될 수 있어 + # 운영 모드는 단일 DB 파일 중심의 DELETE journal로 둔다. + conn.execute('PRAGMA journal_mode=DELETE') + conn.execute('PRAGMA synchronous=FULL') conn.execute('PRAGMA busy_timeout=30000') return conn