fix: [30388f42] Deaktiviere WAL-Modus im Company Explorer (Synology Kompatibilität)
- Entfernt PRAGMA journal_mode=WAL, da dies auf dem Synology-Docker-Volume zu persistierenden Transaktions-Rollbacks führt. - Behält PRAGMA mmap_size=0 und Timeout-Erhöhung bei, um Locking-Probleme im Standard-Journal-Modus zu minimieren. - Ziel: Erfolgreiche Datenbank-Commits wiederherstellen.
This commit is contained in:
@@ -10,13 +10,11 @@ engine = create_engine(
|
||||
connect_args={"check_same_thread": False, "timeout": 30}
|
||||
)
|
||||
|
||||
# Enable WAL mode for SQLite with Docker/Synology optimizations
|
||||
# Disable mmap to avoid Docker volume issues on Synology
|
||||
@event.listens_for(engine, "connect")
|
||||
def set_sqlite_pragma(dbapi_connection, connection_record):
|
||||
cursor = dbapi_connection.cursor()
|
||||
cursor.execute("PRAGMA journal_mode=WAL")
|
||||
cursor.execute("PRAGMA synchronous=NORMAL") # Less aggressive syncing, better for concurrent access
|
||||
cursor.execute("PRAGMA mmap_size=0") # Disable mmap to fix potential Docker volume I/O errors
|
||||
cursor.execute("PRAGMA mmap_size=0")
|
||||
cursor.close()
|
||||
|
||||
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
|
||||
|
||||
Reference in New Issue
Block a user