Skip to content

Commit

Permalink
Merge pull request #3142 from danswer-ai/hotfix/v0.13-session-text
Browse files Browse the repository at this point in the history
Merge hotfix/v0.13-session-text into release/v0.13
  • Loading branch information
rkuo-danswer authored Nov 15, 2024
2 parents 942e47d + fd2428d commit a4f09a6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions backend/danswer/db/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,9 @@ async def get_async_session_with_tenant(
await session.execute(text(f'SET search_path = "{tenant_id}"'))
if POSTGRES_IDLE_SESSIONS_TIMEOUT:
await session.execute(
f"SET SESSION idle_in_transaction_session_timeout = {POSTGRES_IDLE_SESSIONS_TIMEOUT}"
text(
f"SET SESSION idle_in_transaction_session_timeout = {POSTGRES_IDLE_SESSIONS_TIMEOUT}"
)
)
except Exception:
logger.exception("Error setting search_path.")
Expand Down Expand Up @@ -373,7 +375,9 @@ def get_session_with_tenant(
cursor.execute(f'SET search_path = "{tenant_id}"')
if POSTGRES_IDLE_SESSIONS_TIMEOUT:
cursor.execute(
f"SET SESSION idle_in_transaction_session_timeout = {POSTGRES_IDLE_SESSIONS_TIMEOUT}"
text(
f"SET SESSION idle_in_transaction_session_timeout = {POSTGRES_IDLE_SESSIONS_TIMEOUT}"
)
)
finally:
cursor.close()
Expand Down

0 comments on commit a4f09a6

Please sign in to comment.