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

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

Issue 2779323002: token-server: Warmup some local caches in /_ah/warmup. (Closed)
Patch Set: 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
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/logging"
10 "github.com/luci/luci-go/server/warmup" 11 "github.com/luci/luci-go/server/warmup"
12 "github.com/luci/luci-go/tokenserver/appengine/impl/certconfig"
11 ) 13 )
12 14
13 func init() { 15 func init() {
14 warmup.Register("tokenserver/appengine/impl/certchecker", func(c context .Context) error { 16 warmup.Register("tokenserver/appengine/impl/certchecker", func(c context .Context) error {
15 » » // TODO 17 » » names, err := certconfig.ListCAs(c)
18 » » if err != nil {
19 » » » return err
20 » » }
21 » » for _, cn := range names {
22 » » » logging.Infof(c, "Warming up %q", cn)
23 » » » checker, err := GetCertChecker(c, cn)
24 » » » if err == nil {
25 » » » » _, err = checker.GetCA(c)
26 » » » }
27 » » » if err != nil {
28 » » » » logging.WithError(err).Warningf(c, "Failed to wa rm up %q", cn)
nodir 2017/03/29 21:45:06 why it doesn't return err in this case but returns
Vadim Sh. 2017/03/29 21:49:30 Because we don't want to do "return err" here, bef
Vadim Sh. 2017/03/29 23:46:00 Added MultiError.
29 » » » }
30 » » }
16 return nil 31 return nil
17 }) 32 })
18 } 33 }
OLDNEW
« no previous file with comments | « no previous file | tokenserver/appengine/impl/certconfig/ca.go » ('j') | tokenserver/appengine/impl/certconfig/ca.go » ('J')

Powered by Google App Engine
This is Rietveld 408576698