hydra: make nr of build to keep configurable per jobset

This commit is contained in:
Rob Vermaas
2010-08-10 06:48:45 +00:00
parent 34e309f0f7
commit 9d9bf8b264
6 changed files with 29 additions and 41 deletions

View File

@ -47,7 +47,7 @@ foreach my $project ($db->resultset('Projects')->search({hidden => 0},{})) {
# !!! Take time into account? E.g. don't delete builds that
# are younger than N days.
my @systems = $job->builds->search({ }, { select => ["system"], distinct => 1 })->all;
my $keepnr = $job->jobset->keepnr ;
foreach my $system (@systems) {
my @recentBuilds = $job->builds->search(
{ finished => 1
@ -56,7 +56,7 @@ foreach my $project ($db->resultset('Projects')->search({hidden => 0},{})) {
},
{ join => 'resultInfo'
, order_by => 'id DESC'
, rows => 3 # !!! should make this configurable
, rows => $keepnr
});
keepBuild $_ foreach @recentBuilds;
}