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

Unified Diff: milo/appengine/buildbot/grpc.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/grpc.go
diff --git a/milo/appengine/buildbot/grpc.go b/milo/appengine/buildbot/grpc.go
index 7c31cfd544bbe6e36ca112c0f51d6f2d2e7e4c63..ffe969229c564eb0e913875b5cac24e8161f4d95 100644
--- a/milo/appengine/buildbot/grpc.go
+++ b/milo/appengine/buildbot/grpc.go
@@ -25,6 +25,7 @@ type Service struct{}
var errNotFoundGRPC = grpc.Errorf(codes.NotFound, "Master Not Found")
+// GetBuildbotBuildJSON implements milo.BuildbotServer.
func (s *Service) GetBuildbotBuildJSON(
c context.Context, req *milo.BuildbotBuildRequest) (
*milo.BuildbotBuildJSON, error) {
@@ -55,6 +56,7 @@ func (s *Service) GetBuildbotBuildJSON(
return &milo.BuildbotBuildJSON{Data: bs}, nil
}
+// GetBuildbotBuildsJSON implements milo.BuildbotServer.
func (s *Service) GetBuildbotBuildsJSON(
c context.Context, req *milo.BuildbotBuildsRequest) (
*milo.BuildbotBuildsJSON, error) {
@@ -91,7 +93,7 @@ func (s *Service) GetBuildbotBuildsJSON(
q = q.Eq("finished", true)
}
builds := []*buildbotBuild{}
- err = ds.GetAll(c, q, &builds)
+ err = getBuildQueryBatcher(c).GetAll(c, q, &builds)
if err != nil {
return nil, err
}
@@ -151,7 +153,7 @@ func (s *Service) GetCompressedMasterJSON(
}
if err := ds.Get(c, slave.Runningbuilds); err != nil {
logging.WithError(err).Errorf(c,
- "Encountered error while trying to fetch running builds for %s: %s",
+ "Encountered error while trying to fetch running builds for %s: %v",
master.Name, slave.Runningbuilds)
return nil, err
}
@@ -169,7 +171,7 @@ func (s *Service) GetCompressedMasterJSON(
Order("-number").
KeysOnly(true)
var builds []*buildbotBuild
- err := ds.GetAll(c, q, &builds)
+ err := getBuildQueryBatcher(c).GetAll(c, q, &builds)
if err != nil {
return nil, err
}

Powered by Google App Engine
This is Rietveld 408576698