Delete closed bugs after 5 days in recheckwatch
Instead of leaving closed bugs around for 30 days, remove them after 5 days. If a closed bug hasn't reoccurred in 5 days there is a good chance it has been fixed correctly. The number of days to keep around a closed bug is set in by closed_age in the config file. Change-Id: I5d136173ca14a8f9e77a44e29e9499c94a417cd3
This commit is contained in:
parent
151ade5298
commit
1ee0025c0b
@ -102,6 +102,7 @@ class Scoreboard(threading.Thread):
|
||||
self.template_dir = config.get('recheckwatch', 'template_dir')
|
||||
self.output_file = config.get('recheckwatch', 'output_file')
|
||||
self.age = config.getint('recheckwatch', 'age')
|
||||
self.closed_age = config.getint('recheckwatch', 'closed_age')
|
||||
self.regex = re.compile(config.get('recheckwatch', 'regex'))
|
||||
|
||||
if os.path.exists(self.pickle_file):
|
||||
@ -161,10 +162,13 @@ class Scoreboard(threading.Thread):
|
||||
del self.scores[bugno]
|
||||
|
||||
# Remove bugs that haven't been seen in ages
|
||||
# Or closed bugs older then self.closed_age
|
||||
to_remove = []
|
||||
now = datetime.datetime.utcnow()
|
||||
for bugno, bug in self.scores.items():
|
||||
if bug.last_seen < now-datetime.timedelta(days=self.age):
|
||||
if (bug.last_seen < now-datetime.timedelta(days=self.age) or
|
||||
(bug.is_closed() and
|
||||
bug.last_seen < now-datetime.timedelta(days=self.closed_age))):
|
||||
to_remove.append(bugno)
|
||||
for bugno in to_remove:
|
||||
del self.scores[bugno]
|
||||
|
@ -3,6 +3,7 @@ pickle_dir=/var/lib/recheckwatch
|
||||
template_dir=/var/lib/recheckwatch
|
||||
output_file=/var/www/recheckwatch/rechecks.html
|
||||
age=30 ; days
|
||||
closed_age=5 ; days
|
||||
regex=(?i)^(?P<verb>recheck|reverify) (?:bug|lp)[\s#:]*(?P<bugno>\d+)$
|
||||
|
||||
[gerrit]
|
||||
|
Loading…
Reference in New Issue
Block a user