aboutsummaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authorKonstantin Ryabitsev <konstantin@linuxfoundation.org>2022-09-01 10:11:58 -0400
committerKonstantin Ryabitsev <konstantin@linuxfoundation.org>2022-09-01 10:11:58 -0400
commitb62e04aca672c0894638035ca777035f7658a05a (patch)
tree294d065895579ec21a1d6c97bfc586339be378ff /misc
parent7d1a05ed58f244640ab59680ac4b836d7ca726c8 (diff)
downloadb4-b62e04aca672c0894638035ca777035f7658a05a.tar.gz
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 <konstantin@linuxfoundation.org>
Diffstat (limited to 'misc')
-rw-r--r--misc/send-receive.py4
1 files changed, 3 insertions, 1 deletions
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')