forked from lix-project/hydra
hydra: handle case where build to keep set to 0
This commit is contained in:
parent
91fe70522f
commit
0cee7c0909
1 changed files with 13 additions and 8 deletions
|
@ -40,12 +40,17 @@ foreach my $project ($db->resultset('Projects')->all) {
|
||||||
foreach my $jobset ($project->jobsets->all) {
|
foreach my $jobset ($project->jobsets->all) {
|
||||||
my $keepnr = $jobset->keepnr;
|
my $keepnr = $jobset->keepnr;
|
||||||
|
|
||||||
# If the jobset has been disabled for more than one week, than
|
# If the jobset has been disabled for more than one week, than
|
||||||
# don't keep its builds anymore.
|
# don't keep its builds anymore.
|
||||||
if ($jobset->enabled == 0 && (time() - $jobset->lastcheckedtime > (7 * 24 * 3600))) {
|
if ($jobset->enabled == 0 && (time() - $jobset->lastcheckedtime > (7 * 24 * 3600))) {
|
||||||
print STDERR "*** skipping disabled jobset ", $project->name, ":", $jobset->name, "\n";
|
print STDERR "*** skipping disabled jobset ", $project->name, ":", $jobset->name, "\n";
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($keepnr <= 0 ) {
|
||||||
|
print STDERR "*** jobset ", $project->name, ":", $jobset->name, " set to keep 0 builds\n";
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
|
||||||
# Go over all jobs in this jobset.
|
# Go over all jobs in this jobset.
|
||||||
foreach my $job ($jobset->jobs->all) {
|
foreach my $job ($jobset->jobs->all) {
|
||||||
|
@ -68,8 +73,8 @@ foreach my $project ($db->resultset('Projects')->all) {
|
||||||
, rows => $keepnr
|
, rows => $keepnr
|
||||||
});
|
});
|
||||||
keepBuild $_ foreach @recentBuilds;
|
keepBuild $_ foreach @recentBuilds;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Go over all views in this project.
|
# Go over all views in this project.
|
||||||
|
|
Loading…
Reference in a new issue