Restart: Clear failed dependencies

This commit is contained in:
Eelco Dolstra 2015-10-09 15:39:41 +02:00
parent 3fa3e6414c
commit 1a92f971d4

View file

@ -445,13 +445,14 @@ sub restartBuilds($$) {
my @buildIds; my @buildIds;
txn_do($db, sub { txn_do($db, sub {
my @paths; my %paths;
$builds = $builds->search({ finished => 1 }); $builds = $builds->search({ finished => 1 });
foreach my $build ($builds->all) { foreach my $build ($builds->all) {
next if !isValidPath($build->drvpath); 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; push @buildIds, $build->id;
registerRoot $build->drvpath; registerRoot $build->drvpath;
} }
@ -469,8 +470,7 @@ sub restartBuilds($$) {
# Clear the failed paths cache. # Clear the failed paths cache.
# FIXME: Add this to the API. # FIXME: Add this to the API.
# FIXME: clear the dependencies? $db->resultset('FailedPaths')->search({ path => [ keys %paths ]})->delete;
$db->resultset('FailedPaths')->search({ path => [ @paths ]})->delete;
}); });
return scalar(@buildIds); return scalar(@buildIds);