Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions kai_mcp_solution_server/src/kai_mcp_solution_server/db/dao.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,14 @@ async def get_async_engine(url: URL | str) -> AsyncEngine:
echo_pool=False, # Set to True for debugging connection pool
)

@event.listens_for(engine.sync_engine, "connect")
def _set_pg_timeouts(dbapi_conn: Any, conn_record: Any) -> None:
cur = dbapi_conn.cursor()
cur.execute("SET idle_session_timeout = '1min'")
cur.execute("SET idle_in_transaction_session_timeout = '1min'")
cur.execute("SET application_name = 'kai-solution-server'")
cur.close()

return engine


Expand Down
Loading