Call buildFinished when a cached build is added

Signed-off-by: Shea Levy <shea@shealevy.com>
This commit is contained in:
Shea Levy
2013-07-08 13:35:34 -04:00
parent b46f2134e0
commit 166d56088f
5 changed files with 30 additions and 18 deletions

View File

@ -8,6 +8,7 @@ use Nix::Store;
use Hydra::Plugin;
use Hydra::Schema;
use Hydra::Helper::Nix;
use Hydra::Helper::PluginHooks;
use Hydra::Model::DB;
use Hydra::Helper::AddBuilds;
@ -80,19 +81,6 @@ sub failDependents {
}
sub notify {
my ($build, $dependents) = @_;
foreach my $plugin (@plugins) {
eval {
$plugin->buildFinished($build, $dependents);
};
if ($@) {
print STDERR "$plugin->buildFinished: $@\n";
}
}
}
sub doBuild {
my ($build) = @_;
@ -319,7 +307,7 @@ sub doBuild {
});
notify($build, $dependents);
notifyBuildFinished(\@plugins, $build, $dependents);
}
@ -328,7 +316,7 @@ print STDERR "performing build $buildId\n";
if ($ENV{'HYDRA_MAIL_TEST'}) {
my $build = $db->resultset('Builds')->find($buildId);
notify($build, []);
notifyBuildFinished(\@plugins, $build, []);
exit 0;
}

View File

@ -148,7 +148,7 @@ sub checkJobsetWrapped {
foreach my $job (permute @{$jobs->{job}}) {
next if $job->{jobName} eq "";
print STDERR " considering job " . $project->name, ":", $jobset->name, ":", $job->{jobName} . "\n";
checkBuild($db, $project, $jobset, $inputInfo, $nixExprInput, $job, \%buildIds, $prevEval, $jobOutPathMap);
checkBuild($db, $project, $jobset, $inputInfo, $nixExprInput, $job, \%buildIds, $prevEval, $jobOutPathMap, $plugins);
}
# Update the last checked times and error messages for each