Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1353)

Unified Diff: milo/appengine/buildbot/master.go

Issue 2668763002: Use a datastore batcher for build queries. (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: milo/appengine/buildbot/master.go
diff --git a/milo/appengine/buildbot/master.go b/milo/appengine/buildbot/master.go
index fdde75f10fe1f8bf7946524e3512b763dc8e9151..a8fa6d1df2cf5f12b47b92fffc4880959998cf11 100644
--- a/milo/appengine/buildbot/master.go
+++ b/milo/appengine/buildbot/master.go
@@ -49,9 +49,8 @@ func checkAccess(c context.Context, err error, internal bool) error {
case err == ds.ErrNoSuchEntity:
if cu.Identity == identity.AnonymousIdentity {
return errNotAuth
- } else {
- return errMasterNotFound
}
+ return errMasterNotFound
case err != nil:
return err
}
@@ -65,9 +64,8 @@ func checkAccess(c context.Context, err error, internal bool) error {
if !allowed {
if cu.Identity == identity.AnonymousIdentity {
return errNotAuth
- } else {
- return errMasterNotFound
}
+ return errMasterNotFound
}
}
@@ -107,7 +105,7 @@ func GetAllBuilders(c context.Context) (*resp.Module, error) {
q := ds.NewQuery("buildbotMasterEntry")
// TODO(hinoka): Maybe don't look past like a month or so?
entries := []*buildbotMasterEntry{}
- err := ds.GetAll(c, q, &entries)
+ err := (&ds.Batcher{}).GetAll(c, q, &entries)
if err != nil {
return nil, err
}

Powered by Google App Engine
This is Rietveld 408576698