feat(audiobook): add turbo mode for project analysis and enhance log streaming with chapter support
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from sqlalchemy import create_engine
|
||||
from sqlalchemy import create_engine, event
|
||||
from sqlalchemy.orm import sessionmaker, declarative_base
|
||||
|
||||
from config import settings
|
||||
@@ -8,6 +8,12 @@ engine = create_engine(
|
||||
connect_args={"check_same_thread": False} if "sqlite" in settings.DATABASE_URL else {}
|
||||
)
|
||||
|
||||
if "sqlite" in settings.DATABASE_URL:
|
||||
@event.listens_for(engine, "connect")
|
||||
def _set_wal(dbapi_conn, _):
|
||||
dbapi_conn.execute("PRAGMA journal_mode=WAL")
|
||||
dbapi_conn.execute("PRAGMA synchronous=NORMAL")
|
||||
|
||||
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
|
||||
|
||||
Base = declarative_base()
|
||||
|
||||
Reference in New Issue
Block a user