diff --git a/company-explorer/backend/database.py b/company-explorer/backend/database.py index 0fb57c5a..4dd88791 100644 --- a/company-explorer/backend/database.py +++ b/company-explorer/backend/database.py @@ -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)