Skip to content

Commit

Permalink
cont
Browse files Browse the repository at this point in the history
  • Loading branch information
chaen committed Oct 31, 2023
1 parent e8157e8 commit 38b94de
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/diracx/db/sql/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ async def engine_context(self) -> AsyncIterator[None]:
"""
assert self._engine is None, "engine_context cannot be nested"

# Set the pool_recycle to 30mn
# That should prevent the problem of MySQL expiring connection
# after 60mn by default
engine = create_async_engine(self._db_url, pool_recycle=60 * 30)
self._engine = engine

Expand Down

0 comments on commit 38b94de

Please sign in to comment.