From 1a92f971d4648d942090e5a25b0b1e34be779a0b Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 9 Oct 2015 15:39:41 +0200 Subject: [PATCH] Restart: Clear failed dependencies --- src/lib/Hydra/Helper/Nix.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/Hydra/Helper/Nix.pm b/src/lib/Hydra/Helper/Nix.pm index bd0f1ceb..14023c78 100644 --- a/src/lib/Hydra/Helper/Nix.pm +++ b/src/lib/Hydra/Helper/Nix.pm @@ -445,13 +445,14 @@ sub restartBuilds($$) { my @buildIds; txn_do($db, sub { - my @paths; + my %paths; $builds = $builds->search({ finished => 1 }); foreach my $build ($builds->all) { next if !isValidPath($build->drvpath); - push @paths, $_->path foreach $build->buildoutputs->all; + $paths{$_->path} = 1 foreach $build->buildoutputs->all; + $paths{$_->path} = 1 foreach $build->buildstepoutputs->all; push @buildIds, $build->id; registerRoot $build->drvpath; } @@ -469,8 +470,7 @@ sub restartBuilds($$) { # Clear the failed paths cache. # FIXME: Add this to the API. - # FIXME: clear the dependencies? - $db->resultset('FailedPaths')->search({ path => [ @paths ]})->delete; + $db->resultset('FailedPaths')->search({ path => [ keys %paths ]})->delete; }); return scalar(@buildIds);