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
|
@ -176,21 +176,21 @@ sub checkJobsetWrapped {
|
|||
$_->update({ errormsg => $failedJobNames{$_->name} ? join '\n', @{$failedJobNames{$_->name}} : undef })
|
||||
foreach $jobset->jobs->all;
|
||||
|
||||
my $hasNewBuilds = 0;
|
||||
while (my ($id, $x) = each %buildMap) {
|
||||
$hasNewBuilds = 1 if $x->{new};
|
||||
}
|
||||
# Have any builds been added or removed since last time?
|
||||
my $jobsetChanged =
|
||||
(scalar(grep { $_->{new} } values(%buildMap)) > 0)
|
||||
|| (defined $prevEval && $prevEval->jobsetevalmembers->count != scalar(keys %buildMap));
|
||||
|
||||
my $ev = $jobset->jobsetevals->create(
|
||||
{ hash => $argsHash
|
||||
, timestamp => time
|
||||
, checkouttime => abs($checkoutStop - $checkoutStart)
|
||||
, evaltime => abs($evalStop - $evalStart)
|
||||
, hasnewbuilds => $hasNewBuilds
|
||||
, nrbuilds => $hasNewBuilds ? scalar(keys %buildMap) : undef
|
||||
, hasnewbuilds => $jobsetChanged ? 1 : 0
|
||||
, nrbuilds => $jobsetChanged ? scalar(keys %buildMap) : undef
|
||||
});
|
||||
|
||||
if ($hasNewBuilds) {
|
||||
if ($jobsetChanged) {
|
||||
# Create JobsetEvalMembers mappings.
|
||||
while (my ($id, $x) = each %buildMap) {
|
||||
$ev->jobsetevalmembers->create({ build => $id, isnew => $x->{new} });
|
||||
|
|
Loading…
Reference in a new issue