Age in protonmsg config file is deprecated
Fixes: https://pagure.io/koji/issue/3332
This commit is contained in:
parent
f72f033465
commit
ff500a2c4e
1 changed files with 6 additions and 2 deletions
|
|
@ -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'),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue