Skip to content

Commit 0252338

Browse files
committed
Recycling connections after 1h of inactivity | Related to #27
1 parent 9e5ce45 commit 0252338

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

tg_bot/modules/sql/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77

88
def start() -> scoped_session:
9-
engine = create_engine(DB_URI, client_encoding="utf8", pool_pre_ping=True)
9+
engine = create_engine(DB_URI, client_encoding="utf8", pool_pre_ping=True, pool_recycle=3600)
1010
BASE.metadata.bind = engine
1111
BASE.metadata.create_all(engine)
1212
return scoped_session(sessionmaker(bind=engine, autoflush=False))

0 commit comments

Comments
 (0)