From 5b45c94a8362183b316d9ef8f3d1483b01b45ede Mon Sep 17 00:00:00 2001 From: Aevann Date: Fri, 28 Jul 2023 01:05:26 +0300 Subject: [PATCH] add a timelimit on transactions of 10 seconds to avoid holding locks for a minute --- files/helpers/config/const.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/helpers/config/const.py b/files/helpers/config/const.py index 05eba0cf0..bbeb087d4 100644 --- a/files/helpers/config/const.py +++ b/files/helpers/config/const.py @@ -1138,5 +1138,5 @@ class OrgyTypes: from sqlalchemy.engine.create import create_engine from sqlalchemy.orm import scoped_session, sessionmaker -engine = create_engine(environ.get("DATABASE_URL").strip(), connect_args={"options": "-c statement_timeout=5000"}) +engine = create_engine(environ.get("DATABASE_URL").strip(), connect_args={"options": "-c statement_timeout=5000 -c idle_in_transaction_session_timeout=10000"}) db_session = scoped_session(sessionmaker(bind=engine))