Skip to content
Snippets Groups Projects
Commit 45cdb48d authored by !! Julian Keck (old Account; do not use) !!'s avatar !! Julian Keck (old Account; do not use) !! :ghost:
Browse files

FIX kill stale middleware sessions with postgres

parent a6c14016
No related branches found
No related tags found
No related merge requests found
......@@ -25,6 +25,9 @@ def get_conn(request: Request):
# db_connection = db.connect()
query = "SET search_path TO netadmin, public;"
db.execute(db_connection, query)
db.execute(db_connection, "SET idle_in_transaction_session_timeout TO '60s';")
db.execute(db_connection, "SET idle_session_timeout TO '60s';")
db.execute(db_connection, "SET statement_timeout TO '60s';")
db_connection.commit()
request.state.db_conn = db_connection
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment