make failed buildroot lifetime configurable

This commit is contained in:
Mike McLean 2012-01-14 15:33:34 -05:00
parent b2edd9011c
commit cf508c1c62
2 changed files with 2 additions and 1 deletions

View file

@ -2910,6 +2910,7 @@ def get_options():
'allowed_scms': '',
'maven_repo_ignore': '*.md5 *.sha1 maven-metadata*.xml _maven.repositories '
'resolver-status.properties *.lastUpdated',
'failed_buildroot_lifetime' : 3600 * 4,
'cert': '/etc/kojid/client.crt',
'ca': '/etc/kojid/clientca.crt',
'serverca': '/etc/kojid/serverca.crt'}

View file

@ -531,7 +531,7 @@ class TaskManager(object):
if not task:
self.logger.warn("%s: invalid task %s" % (desc, br['task_id']))
continue
if (task['state'] == koji.TASK_STATES['FAILED'] and age < 3600 * 4):
if (task['state'] == koji.TASK_STATES['FAILED'] and age < self.options.failed_buildroot_lifetime):
#XXX - this could be smarter
# keep buildroots for failed tasks around for a little while
self.logger.debug("Keeping failed buildroot: %s" % desc)