We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1d8e662 commit b6ecbbcCopy full SHA for b6ecbbc
backend/danswer/db/engine.py
@@ -310,8 +310,12 @@ async def get_async_session_with_tenant(
310
try:
311
# Set the search_path to the tenant's schema
312
await session.execute(text(f'SET search_path = "{tenant_id}"'))
313
- except Exception as e:
314
- logger.error(f"Error setting search_path: {str(e)}")
+ if POSTGRES_IDLE_SESSIONS_TIMEOUT:
+ await session.execute(
315
+ f"SET SESSION idle_in_transaction_session_timeout = {POSTGRES_IDLE_SESSIONS_TIMEOUT}"
316
+ )
317
+ except Exception:
318
+ logger.exception("Error setting search_path.")
319
# You can choose to re-raise the exception or handle it
320
# Here, we'll re-raise to prevent proceeding with an incorrect session
321
raise
0 commit comments