Skip to content

Commit

Permalink
Fix issue with duplicate build_finished trigger in RunCommand for fai…
Browse files Browse the repository at this point in the history
…led builds.
  • Loading branch information
rbvermaa committed Dec 13, 2023
1 parent bf8f019 commit a2004ca
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/lib/Hydra/Plugin/RunCommand.pm
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,18 @@ sub _buildFinished {

sub buildFinished {
my ($self, $topbuild, $dependents) = @_;


# tracking builds we have triggered, as for failed jobs, original build can be in dependents
my @builds = ();
foreach my $build ($topbuild, @{$dependents}) {
_buildFinished($self, $build)
my $id = $build->id;
if (grep(/^$id/, @builds)) {
print STDERR "Skipped $id, already triggered.\n";
} else {
_buildFinished($self, $build);
push(@builds, $id);
}
}
}

Expand Down

0 comments on commit a2004ca

Please sign in to comment.