Index: tokenserver/appengine/impl/certchecker/warmup.go |
diff --git a/tokenserver/appengine/impl/certchecker/warmup.go b/tokenserver/appengine/impl/certchecker/warmup.go |
index 8307d0aaac1f54b3999501e45d7eaec2d50e7f3c..c31a1824f54e30333eda53c56c78a973d1f6ffea 100644 |
--- a/tokenserver/appengine/impl/certchecker/warmup.go |
+++ b/tokenserver/appengine/impl/certchecker/warmup.go |
@@ -7,12 +7,27 @@ package certchecker |
import ( |
"golang.org/x/net/context" |
+ "github.com/luci/luci-go/common/logging" |
"github.com/luci/luci-go/server/warmup" |
+ "github.com/luci/luci-go/tokenserver/appengine/impl/certconfig" |
) |
func init() { |
warmup.Register("tokenserver/appengine/impl/certchecker", func(c context.Context) error { |
- // TODO |
+ names, err := certconfig.ListCAs(c) |
+ if err != nil { |
+ return err |
+ } |
+ for _, cn := range names { |
+ logging.Infof(c, "Warming up %q", cn) |
+ checker, err := GetCertChecker(c, cn) |
+ if err == nil { |
+ _, err = checker.GetCA(c) |
+ } |
+ if err != nil { |
+ logging.WithError(err).Warningf(c, "Failed to warm 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.
|
+ } |
+ } |
return nil |
}) |
} |