test fix: mysql timeout correction
Browse filesThis pr tries to fix mysql timeout after a long time without using it by checking each hour and pre pinging before conection
- mysqlchatstore.py +1 -1
mysqlchatstore.py
CHANGED
|
@@ -42,7 +42,7 @@ class MySQLChatStore(BaseChatStore):
|
|
| 42 |
"""
|
| 43 |
Cria e retorna um sessionmaker síncrono e um sessionmaker assíncrono.
|
| 44 |
"""
|
| 45 |
-
engine = create_engine(connection_string, echo=False)
|
| 46 |
session = sessionmaker(bind=engine)
|
| 47 |
|
| 48 |
async_engine = create_async_engine(async_connection_string)
|
|
|
|
| 42 |
"""
|
| 43 |
Cria e retorna um sessionmaker síncrono e um sessionmaker assíncrono.
|
| 44 |
"""
|
| 45 |
+
engine = create_engine(connection_string, echo=False, pool_pre_ping=True, pool_recycle=3600)
|
| 46 |
session = sessionmaker(bind=engine)
|
| 47 |
|
| 48 |
async_engine = create_async_engine(async_connection_string)
|