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

Unified Diff: tokenserver/appengine/impl/certconfig/rpc_list_cas.go

Issue 2779323002: token-server: Warmup some local caches in /_ah/warmup. (Closed)
Patch Set: also warmup delegation config Created 3 years, 9 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
« no previous file with comments | « tokenserver/appengine/impl/certconfig/ca_test.go ('k') | tokenserver/appengine/impl/certconfig/warmup.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tokenserver/appengine/impl/certconfig/rpc_list_cas.go
diff --git a/tokenserver/appengine/impl/certconfig/rpc_list_cas.go b/tokenserver/appengine/impl/certconfig/rpc_list_cas.go
index 9e052840640146f982cdcd1788aa2eb1745710ed..5caf043aa3fed81eb3cc771e01685b198f717d61 100644
--- a/tokenserver/appengine/impl/certconfig/rpc_list_cas.go
+++ b/tokenserver/appengine/impl/certconfig/rpc_list_cas.go
@@ -10,7 +10,6 @@ import (
"google.golang.org/grpc/codes"
"github.com/golang/protobuf/ptypes/empty"
- ds "github.com/luci/gae/service/datastore"
"github.com/luci/luci-go/tokenserver/api/admin/v1"
)
@@ -21,18 +20,9 @@ type ListCAsRPC struct {
// ListCAs returns a list of Common Names of registered CAs.
func (r *ListCAsRPC) ListCAs(c context.Context, _ *empty.Empty) (*admin.ListCAsResponse, error) {
- keys := []*ds.Key{}
-
- q := ds.NewQuery("CA").Eq("Removed", false).KeysOnly(true)
- if err := ds.GetAll(c, q, &keys); err != nil {
+ names, err := ListCAs(c)
+ if err != nil {
return nil, grpc.Errorf(codes.Internal, "transient datastore error - %s", err)
}
-
- resp := &admin.ListCAsResponse{
- Cn: make([]string, len(keys)),
- }
- for i, key := range keys {
- resp.Cn[i] = key.StringID()
- }
- return resp, nil
+ return &admin.ListCAsResponse{Cn: names}, nil
}
« no previous file with comments | « tokenserver/appengine/impl/certconfig/ca_test.go ('k') | tokenserver/appengine/impl/certconfig/warmup.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698