From b62e04aca672c0894638035ca777035f7658a05a Mon Sep 17 00:00:00 2001 From: Konstantin Ryabitsev Date: Thu, 1 Sep 2022 10:11:58 -0400 Subject: send-receive: don't keep db connections open for long We expect to be mostly sitting idle, so close any pooled db connections after 5 minutes of inactivity. Signed-off-by: Konstantin Ryabitsev --- misc/send-receive.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/misc/send-receive.py b/misc/send-receive.py index 4900dc6..c15e12a 100644 --- a/misc/send-receive.py +++ b/misc/send-receive.py @@ -520,7 +520,9 @@ if gpgbin: patatt.GPGBIN = gpgbin dburl = parser['main'].get('dburl') -engine = sa.create_engine(dburl) +# By default, recycle db connections after 5 min +db_pool_recycle = parser['main'].getint('dbpoolrecycle', 300) +engine = sa.create_engine(dburl, pool_recycle=db_pool_recycle) srl = SendReceiveListener(engine, parser) app = falcon.App() mp = os.getenv('MOUNTPOINT', '/_b4_submit') -- cgit v1.2.3