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

Side by Side Diff: tokenserver/appengine/impl/certchecker/warmup.go

Issue 2779323002: token-server: Warmup some local caches in /_ah/warmup. (Closed)
Patch Set: also warmup delegation config Created 3 years, 8 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 unified diff | Download patch
« no previous file with comments | « no previous file | tokenserver/appengine/impl/certconfig/ca.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The LUCI Authors. All rights reserved. 1 // Copyright 2017 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 certchecker 5 package certchecker
6 6
7 import ( 7 import (
8 "golang.org/x/net/context" 8 "golang.org/x/net/context"
9 9
10 "github.com/luci/luci-go/common/errors"
11 "github.com/luci/luci-go/common/logging"
10 "github.com/luci/luci-go/server/warmup" 12 "github.com/luci/luci-go/server/warmup"
13 "github.com/luci/luci-go/tokenserver/appengine/impl/certconfig"
11 ) 14 )
12 15
13 func init() { 16 func init() {
14 warmup.Register("tokenserver/appengine/impl/certchecker", func(c context .Context) error { 17 warmup.Register("tokenserver/appengine/impl/certchecker", func(c context .Context) error {
15 » » // TODO 18 » » names, err := certconfig.ListCAs(c)
16 » » return nil 19 » » if err != nil {
20 » » » return err
21 » » }
22 » » var merr errors.MultiError
23 » » for _, cn := range names {
24 » » » logging.Infof(c, "Warming up %q", cn)
25 » » » checker, err := GetCertChecker(c, cn)
26 » » » if err == nil {
27 » » » » _, err = checker.GetCA(c)
28 » » » }
29 » » » if err != nil {
30 » » » » logging.WithError(err).Warningf(c, "Failed to wa rm up %q", cn)
31 » » » » merr = append(merr, err)
32 » » » }
33 » » }
34 » » if len(merr) == 0 {
35 » » » return nil
36 » » }
37 » » return merr
17 }) 38 })
18 } 39 }
OLDNEW
« no previous file with comments | « no previous file | tokenserver/appengine/impl/certconfig/ca.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698