forked from lix-project/hydra
Force creation of a new uncached eval if jobs have been removed
Previously we only checked if jobs had been added. We should probably rename the "hasNewBuilds" field in the database.
This commit is contained in:
parent
a04c117eb6
commit
647d6bc3f1
1 changed files with 7 additions and 7 deletions
|
@ -176,21 +176,21 @@ sub checkJobsetWrapped {
|
||||||
$_->update({ errormsg => $failedJobNames{$_->name} ? join '\n', @{$failedJobNames{$_->name}} : undef })
|
$_->update({ errormsg => $failedJobNames{$_->name} ? join '\n', @{$failedJobNames{$_->name}} : undef })
|
||||||
foreach $jobset->jobs->all;
|
foreach $jobset->jobs->all;
|
||||||
|
|
||||||
my $hasNewBuilds = 0;
|
# Have any builds been added or removed since last time?
|
||||||
while (my ($id, $x) = each %buildMap) {
|
my $jobsetChanged =
|
||||||
$hasNewBuilds = 1 if $x->{new};
|
(scalar(grep { $_->{new} } values(%buildMap)) > 0)
|
||||||
}
|
|| (defined $prevEval && $prevEval->jobsetevalmembers->count != scalar(keys %buildMap));
|
||||||
|
|
||||||
my $ev = $jobset->jobsetevals->create(
|
my $ev = $jobset->jobsetevals->create(
|
||||||
{ hash => $argsHash
|
{ hash => $argsHash
|
||||||
, timestamp => time
|
, timestamp => time
|
||||||
, checkouttime => abs($checkoutStop - $checkoutStart)
|
, checkouttime => abs($checkoutStop - $checkoutStart)
|
||||||
, evaltime => abs($evalStop - $evalStart)
|
, evaltime => abs($evalStop - $evalStart)
|
||||||
, hasnewbuilds => $hasNewBuilds
|
, hasnewbuilds => $jobsetChanged ? 1 : 0
|
||||||
, nrbuilds => $hasNewBuilds ? scalar(keys %buildMap) : undef
|
, nrbuilds => $jobsetChanged ? scalar(keys %buildMap) : undef
|
||||||
});
|
});
|
||||||
|
|
||||||
if ($hasNewBuilds) {
|
if ($jobsetChanged) {
|
||||||
# Create JobsetEvalMembers mappings.
|
# Create JobsetEvalMembers mappings.
|
||||||
while (my ($id, $x) = each %buildMap) {
|
while (my ($id, $x) = each %buildMap) {
|
||||||
$ev->jobsetevalmembers->create({ build => $id, isnew => $x->{new} });
|
$ev->jobsetevalmembers->create({ build => $id, isnew => $x->{new} });
|
||||||
|
|
Loading…
Reference in a new issue