Restodecoca commited on
Commit
1039cc4
·
verified ·
1 Parent(s): bdecbc1

test fix: mysql timeout correction

Browse files

This pr tries to fix mysql timeout after a long time without using it by checking each hour and pre pinging before conection

Files changed (1) hide show
  1. 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)