session maker updated
This commit is contained in:
parent
bd428e2f58
commit
f3b053af78
|
|
@ -14,7 +14,7 @@ engine = create_engine(
|
||||||
pool_pre_ping=True, # Verify connection before using
|
pool_pre_ping=True, # Verify connection before using
|
||||||
pool_size=20, # Maximum number of permanent connections
|
pool_size=20, # Maximum number of permanent connections
|
||||||
max_overflow=10, # Maximum number of additional connections
|
max_overflow=10, # Maximum number of additional connections
|
||||||
pool_recycle=3600, # Recycle connections after 1 hour
|
pool_recycle=600, # Recycle connections after 1 hour
|
||||||
pool_timeout=30, # Wait up to 30 seconds for a connection
|
pool_timeout=30, # Wait up to 30 seconds for a connection
|
||||||
echo=True, # Set to True for debugging SQL queries
|
echo=True, # Set to True for debugging SQL queries
|
||||||
)
|
)
|
||||||
|
|
@ -30,7 +30,7 @@ def get_session_factory() -> scoped_session:
|
||||||
bind=engine,
|
bind=engine,
|
||||||
autocommit=False,
|
autocommit=False,
|
||||||
autoflush=False,
|
autoflush=False,
|
||||||
expire_on_commit=False, # Prevent expired object issues
|
expire_on_commit=True, # Prevent expired object issues
|
||||||
)
|
)
|
||||||
return scoped_session(session_local)
|
return scoped_session(session_local)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue