hydra: when restarting a build, remove possible failed dependencies from the failed-cache.

This commit is contained in:
Rob Vermaas 2010-08-11 06:43:59 +00:00
parent f7ce960b96
commit c174998a0c

View file

@ -360,9 +360,13 @@ sub restart : Chained('build') PathPart Args(0) {
requireProjectOwner($c, $build->project);
txn_do($c->model('DB')->schema, sub {
my $drvpath = $build->drvpath ;
error($c, "This build cannot be restarted.")
unless $build->finished;
unless $build->finished && -f $drvpath ;
my $cmd = "`nix-store -qR $drvpath`";
my $r = `nix-store --clear-failed-paths $cmd`;
$build->update({finished => 0, timestamp => time});
$build->resultInfo->delete;