Merge pull request #996 from DeterminateSystems/cleanup-build-finished
hydra-notify: move buildFinished query in to the function impl
This commit is contained in:
commit
f30addb9d7
|
@ -47,7 +47,10 @@ sub buildStarted {
|
||||||
}
|
}
|
||||||
|
|
||||||
sub buildFinished {
|
sub buildFinished {
|
||||||
my ($build, @deps) = @_;
|
my ($buildId, @deps) = @_;
|
||||||
|
|
||||||
|
my $build = $db->resultset('Builds')->find($buildId)
|
||||||
|
or die "build $buildId does not exist\n";
|
||||||
|
|
||||||
my $project = $build->project;
|
my $project = $build->project;
|
||||||
my $jobsetName = $build->get_column('jobset');
|
my $jobsetName = $build->get_column('jobset');
|
||||||
|
@ -107,7 +110,7 @@ for my $build ($db->resultset('Builds')->search(
|
||||||
{
|
{
|
||||||
my $buildId = $build->id;
|
my $buildId = $build->id;
|
||||||
print STDERR "sending notifications for build ${\$buildId}...\n";
|
print STDERR "sending notifications for build ${\$buildId}...\n";
|
||||||
buildFinished($build);
|
buildFinished($build->id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -130,9 +133,7 @@ while (!$queued_only) {
|
||||||
buildStarted(int($payload[0]));
|
buildStarted(int($payload[0]));
|
||||||
} elsif ($channelName eq "build_finished") {
|
} elsif ($channelName eq "build_finished") {
|
||||||
my $buildId = int($payload[0]);
|
my $buildId = int($payload[0]);
|
||||||
my $build = $db->resultset('Builds')->find($buildId)
|
buildFinished($buildId, @payload[1..$#payload]);
|
||||||
or die "build $buildId does not exist\n";
|
|
||||||
buildFinished($build, @payload[1..$#payload]);
|
|
||||||
} elsif ($channelName eq "step_finished") {
|
} elsif ($channelName eq "step_finished") {
|
||||||
stepFinished(int($payload[0]), int($payload[1]));
|
stepFinished(int($payload[0]), int($payload[1]));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue