| OLD | NEW |
| 1 // Copyright 2016 The LUCI Authors. All rights reserved. | 1 // Copyright 2016 The LUCI Authors. All rights reserved. |
| 2 // Use of this source code is governed under the Apache License, Version 2.0 | 2 // Use of this source code is governed under the Apache License, Version 2.0 |
| 3 // that can be found in the LICENSE file. | 3 // that can be found in the LICENSE file. |
| 4 | 4 |
| 5 package buildbot | 5 package buildbot |
| 6 | 6 |
| 7 import ( | 7 import ( |
| 8 "fmt" | 8 "fmt" |
| 9 "net/http" | 9 "net/http" |
| 10 "sort" | 10 "sort" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 result := []*resp.BuildSummary{} | 60 result := []*resp.BuildSummary{} |
| 61 q := ds.NewQuery("buildbotBuild") | 61 q := ds.NewQuery("buildbotBuild") |
| 62 q = q.Eq("finished", finished) | 62 q = q.Eq("finished", finished) |
| 63 q = q.Eq("master", masterName) | 63 q = q.Eq("master", masterName) |
| 64 q = q.Eq("builder", builderName) | 64 q = q.Eq("builder", builderName) |
| 65 if limit != 0 { | 65 if limit != 0 { |
| 66 q = q.Limit(int32(limit)) | 66 q = q.Limit(int32(limit)) |
| 67 } | 67 } |
| 68 q = q.Order("-number") | 68 q = q.Order("-number") |
| 69 buildbots := []*buildbotBuild{} | 69 buildbots := []*buildbotBuild{} |
| 70 » err := ds.GetAll(c, q, &buildbots) | 70 » err := getBuildQueryBatcher(c).GetAll(c, q, &buildbots) |
| 71 if err != nil { | 71 if err != nil { |
| 72 return nil, err | 72 return nil, err |
| 73 } | 73 } |
| 74 for _, b := range buildbots { | 74 for _, b := range buildbots { |
| 75 result = append(result, getBuildSummary(b)) | 75 result = append(result, getBuildSummary(b)) |
| 76 } | 76 } |
| 77 return result, nil | 77 return result, nil |
| 78 } | 78 } |
| 79 | 79 |
| 80 var errMasterNotFound = miloerror.Error{ | 80 var errMasterNotFound = miloerror.Error{ |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 } | 155 } |
| 156 result.CurrentBuilds = currentBuilds | 156 result.CurrentBuilds = currentBuilds |
| 157 | 157 |
| 158 for _, fb := range finishedBuilds { | 158 for _, fb := range finishedBuilds { |
| 159 if fb != nil { | 159 if fb != nil { |
| 160 result.FinishedBuilds = append(result.FinishedBuilds, fb
) | 160 result.FinishedBuilds = append(result.FinishedBuilds, fb
) |
| 161 } | 161 } |
| 162 } | 162 } |
| 163 return result, nil | 163 return result, nil |
| 164 } | 164 } |
| OLD | NEW |