From c9bca5b91012f7ca37ef98e1784c582e15e66a8d Mon Sep 17 00:00:00 2001 From: Tomas Kopecek Date: May 09 2022 11:59:19 +0000 Subject: PR#3344: Fix age to max_age in protonmsg Merges #3344 https://pagure.io/koji/pull-request/3344 Fixes: #3332 https://pagure.io/koji/issue/3332 protonmsg: age config name mismatch --- diff --git a/plugins/hub/protonmsg.py b/plugins/hub/protonmsg.py index 702028e..3b90a3f 100644 --- a/plugins/hub/protonmsg.py +++ b/plugins/hub/protonmsg.py @@ -361,8 +361,12 @@ def handle_db_msgs(urls, CONFIG): LOG.debug('skipping db queue due to lock') return try: - c.execute("DELETE FROM proton_queue WHERE created_ts < NOW() -'%s hours'::interval" % - CONFIG.getint('queue', 'age', fallback=24)) + max_age = CONFIG.getint('queue', 'max_age', fallback=None) + if not max_age: + # age in config file is deprecated + max_age = CONFIG.getint('queue', 'age', fallback=24) + c.execute("DELETE FROM proton_queue WHERE created_ts < NOW() -'%s hours'::interval" + % max_age) query = QueryProcessor(tables=('proton_queue',), columns=('id', 'address', 'props', 'body::TEXT'), aliases=('id', 'address', 'props', 'body'),