mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-06-27 16:30:56 +02:00
use text()
This commit is contained in:
parent
485f3f72fa
commit
65a205d488
@ -312,7 +312,9 @@ async def get_async_session_with_tenant(
|
|||||||
await session.execute(text(f'SET search_path = "{tenant_id}"'))
|
await session.execute(text(f'SET search_path = "{tenant_id}"'))
|
||||||
if POSTGRES_IDLE_SESSIONS_TIMEOUT:
|
if POSTGRES_IDLE_SESSIONS_TIMEOUT:
|
||||||
await session.execute(
|
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:
|
except Exception:
|
||||||
logger.exception("Error setting search_path.")
|
logger.exception("Error setting search_path.")
|
||||||
@ -373,7 +375,9 @@ def get_session_with_tenant(
|
|||||||
cursor.execute(f'SET search_path = "{tenant_id}"')
|
cursor.execute(f'SET search_path = "{tenant_id}"')
|
||||||
if POSTGRES_IDLE_SESSIONS_TIMEOUT:
|
if POSTGRES_IDLE_SESSIONS_TIMEOUT:
|
||||||
cursor.execute(
|
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:
|
finally:
|
||||||
cursor.close()
|
cursor.close()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user