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

Unified Diff: tokenserver/appengine/impl/delegation/config.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
Index: tokenserver/appengine/impl/delegation/config.go
diff --git a/tokenserver/appengine/impl/delegation/config.go b/tokenserver/appengine/impl/delegation/config.go
index 7743d38a57750a01b871d4358232a2ef39c2ce13..2a24f210571e246016c2a95d88a391ced604495d 100644
--- a/tokenserver/appengine/impl/delegation/config.go
+++ b/tokenserver/appengine/impl/delegation/config.go
@@ -97,11 +97,15 @@ func FetchDelegationConfig(c context.Context) (*DelegationConfig, error) {
return cfg, nil
}
-// DelegationConfigLoader constructs a function that lazy-loads delegation
-// config and keeps it cached in memory, refreshing the cached copy each minute.
+// DelegationConfigLoader lazy-loads delegation config and keeps it cached in
+// memory, refreshing the cached copy each minute.
//
// Used as MintDelegationTokenRPC.ConfigLoader implementation in prod.
-func DelegationConfigLoader() func(context.Context) (*DelegationConfig, error) {
+var DelegationConfigLoader = delegationConfigLoader()
+
+// delegationConfigLoader constructs a function that lazy-loads delegation
+// config and keeps it cached in memory, refreshing the cached copy each minute.
+func delegationConfigLoader() func(context.Context) (*DelegationConfig, error) {
slot := lazyslot.Slot{
Fetcher: func(c context.Context, prev lazyslot.Value) (lazyslot.Value, error) {
newCfg, err := FetchDelegationConfig(c)
« no previous file with comments | « tokenserver/appengine/impl/certconfig/warmup.go ('k') | tokenserver/appengine/impl/delegation/config_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698