From 1eb5cc8df31ef6d29de0f38a9680be7e9c6c2aaf Mon Sep 17 00:00:00 2001 From: Floke Date: Fri, 6 Mar 2026 16:14:46 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20[30388f42]=20Optimiere=20SQLite=20Config?= =?UTF-8?q?=20f=C3=BCr=20Synology/Docker=20(Fix=20ROLLBACKs)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Setzt PRAGMA synchronous=NORMAL und PRAGMA mmap_size=0. - Deaktiviert Memory Mapping, da dies auf Docker-Volumes (Synology) oft zu I/O-Fehlern und fehlgeschlagenen Commits führt. - Soll die mysteriösen ROLLBACKs im Company Explorer beheben. --- company-explorer/backend/database.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/company-explorer/backend/database.py b/company-explorer/backend/database.py index a78fee66..0fb57c5a 100644 --- a/company-explorer/backend/database.py +++ b/company-explorer/backend/database.py @@ -10,11 +10,13 @@ engine = create_engine( connect_args={"check_same_thread": False, "timeout": 30} ) -# Enable WAL mode for SQLite +# Enable WAL mode for SQLite with Docker/Synology optimizations @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.close() SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)