OLD | NEW |
---|---|
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 } |
OLD | NEW |