dashboard/builder: finish the previous -report=false change

We weren't using the *report flag enough.

LGTM=proppy
R=proppy
CC=golang-codereviews
https://golang.org/cl/132650043
This commit is contained in:
Brad Fitzpatrick 2014-09-05 14:48:12 -07:00
parent cb318644df
commit d30a33e346
2 changed files with 14 additions and 1 deletions

View File

@ -123,6 +123,9 @@ func (b *Builder) todo(kinds []string, pkg, goHash string) (kind, rev string, be
// recordResult sends build results to the dashboard // recordResult sends build results to the dashboard
func (b *Builder) recordResult(ok bool, pkg, hash, goHash, buildLog string, runTime time.Duration) error { func (b *Builder) recordResult(ok bool, pkg, hash, goHash, buildLog string, runTime time.Duration) error {
if !*report {
return nil
}
req := obj{ req := obj{
"Builder": b.name, "Builder": b.name,
"PackagePath": pkg, "PackagePath": pkg,
@ -158,12 +161,18 @@ type PerfArtifact struct {
// recordPerfResult sends benchmarking results to the dashboard // recordPerfResult sends benchmarking results to the dashboard
func (b *Builder) recordPerfResult(req *PerfResult) error { func (b *Builder) recordPerfResult(req *PerfResult) error {
if !*report {
return nil
}
req.Builder = b.name req.Builder = b.name
args := url.Values{"key": {b.key}, "builder": {b.name}} args := url.Values{"key": {b.key}, "builder": {b.name}}
return dash("POST", "perf-result", args, req, nil) return dash("POST", "perf-result", args, req, nil)
} }
func postCommit(key, pkg string, l *HgLog) error { func postCommit(key, pkg string, l *HgLog) error {
if !*report {
return nil
}
t, err := time.Parse(time.RFC3339, l.Date) t, err := time.Parse(time.RFC3339, l.Date)
if err != nil { if err != nil {
return fmt.Errorf("parsing %q: %v", l.Date, t) return fmt.Errorf("parsing %q: %v", l.Date, t)

View File

@ -625,7 +625,11 @@ func isFile(name string) bool {
// commitWatcher polls hg for new commits and tells the dashboard about them. // commitWatcher polls hg for new commits and tells the dashboard about them.
func commitWatcher(goroot *Repo) { func commitWatcher(goroot *Repo) {
if *commitInterval == 0 { if *commitInterval == 0 {
log.Printf("commitInterval is %s, disabling commitWatcher", *commitInterval) log.Printf("commitInterval is 0; disabling commitWatcher")
return
}
if !*report {
log.Printf("-report is false; disabling commitWatcher")
return return
} }
// Create builder just to get master key. // Create builder just to get master key.