Repair dashboard database and disable WAL mode
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -21,4 +21,5 @@ Thumbs.db
|
|||||||
# SQLite runtime files / local recovery backups
|
# SQLite runtime files / local recovery backups
|
||||||
*.db-wal
|
*.db-wal
|
||||||
*.db-shm
|
*.db-shm
|
||||||
|
*.db.bak-*
|
||||||
db-backups/
|
db-backups/
|
||||||
|
|||||||
BIN
matching.db
BIN
matching.db
Binary file not shown.
@@ -56,8 +56,11 @@ DB_WRITE_LOCK = threading.Lock()
|
|||||||
|
|
||||||
|
|
||||||
def configure_sqlite_connection(conn):
|
def configure_sqlite_connection(conn):
|
||||||
conn.execute('PRAGMA journal_mode=WAL')
|
# Docker에서 8091/8092가 같은 SQLite 파일을 bind mount로 공유한다.
|
||||||
conn.execute('PRAGMA synchronous=NORMAL')
|
# WAL/SHM 파일이 남은 상태에서 컨테이너 재시작/복구가 섞이면 malformed가 반복될 수 있어
|
||||||
|
# 운영 모드는 단일 DB 파일 중심의 DELETE journal로 둔다.
|
||||||
|
conn.execute('PRAGMA journal_mode=DELETE')
|
||||||
|
conn.execute('PRAGMA synchronous=FULL')
|
||||||
conn.execute('PRAGMA busy_timeout=30000')
|
conn.execute('PRAGMA busy_timeout=30000')
|
||||||
return conn
|
return conn
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user