diff --git a/src/lib/Hydra/Controller/Build.pm b/src/lib/Hydra/Controller/Build.pm index f9f1825a..b3442f02 100644 --- a/src/lib/Hydra/Controller/Build.pm +++ b/src/lib/Hydra/Controller/Build.pm @@ -351,9 +351,9 @@ sub restart : Chained('build') PathPart Args(0) { requireProjectOwner($c, $build->project); - my $drvpath = $build->drvpath ; + my $drvpath = $build->drvpath; error($c, "This build cannot be restarted.") - unless $build->finished && -f $drvpath ; + unless $build->finished && -f $drvpath; restartBuild($c->model('DB')->schema, $build); diff --git a/src/lib/Hydra/Helper/AddBuilds.pm b/src/lib/Hydra/Helper/AddBuilds.pm index c6c7703a..1e9bd0e7 100644 --- a/src/lib/Hydra/Helper/AddBuilds.pm +++ b/src/lib/Hydra/Helper/AddBuilds.pm @@ -968,5 +968,11 @@ sub restartBuild { , busy => 0 , locker => "" }); + + # Reset the stats for the evals to which this build belongs. + # !!! Should do this in a trigger. + foreach my $m ($build->jobsetevalmembers->all) { + $m->eval->update({nrsucceeded => undef}); + } }); }