only record rusage if build was successful

This commit is contained in:
Giovanni Harting 2023-03-14 01:36:11 +01:00
parent ece8c4c7d9
commit cf4f91295f
2 changed files with 5 additions and 6 deletions

View File

@ -220,7 +220,6 @@ func (b *BuildManager) buildQueue(queue []*ProtoPackage, ctx context.Context) er
unknownBuilds = true
}
b.buildingLock.RUnlock()
up = 0
}
return nil
}

View File

@ -263,11 +263,11 @@ func (p *ProtoPackage) build(ctx context.Context) (time.Duration, error) {
SetStatus(dbpackage.StatusFailed).
ClearSkipReason().
SetBuildTimeStart(start).
SetMaxRss(Rusage.Maxrss).
SetIoOut(Rusage.Oublock).
SetIoIn(Rusage.Inblock).
SetUTime(Rusage.Utime.Sec).
SetSTime(Rusage.Stime.Sec).
ClearMaxRss().
ClearIoOut().
ClearIoIn().
ClearUTime().
ClearSTime().
SetHash(p.Hash).
ExecX(ctx)
return time.Since(start), fmt.Errorf("build failed: exit code %d", cmd.ProcessState.ExitCode())