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

Unified Diff: appengine/logdog/coordinator/config/config.go

Issue 1863973002: LogDog: Update to archival V2. (Closed) Base URL: https://github.com/luci/luci-go@grpcutil-errors
Patch Set: Fix proto comment. Created 4 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 side-by-side diff with in-line comments
Download patch
Index: appengine/logdog/coordinator/config/config.go
diff --git a/appengine/logdog/coordinator/config/config.go b/appengine/logdog/coordinator/config/config.go
index 3cdf7c82790b11e082a893f86cf2747e55edf7d9..eff6d9482e0289626cb4714f6d0c7dc4d1ef3985 100644
--- a/appengine/logdog/coordinator/config/config.go
+++ b/appengine/logdog/coordinator/config/config.go
@@ -59,11 +59,24 @@ type DevConfig struct {
// If no global configuration is present, settings.ErrNoSettings will be
// returned.
func LoadGlobalConfig(c context.Context) (*GlobalConfig, error) {
- gc := GlobalConfig{}
- if err := settings.Get(c, globalConfigSettingsKey, &gc); err != nil {
+ gcfg := GlobalConfig{}
+ if err := settings.Get(c, globalConfigSettingsKey, &gcfg); err != nil {
+ // If we're running the dev appserver, install some configuration stubs so
+ // they can be tweaked locally.
+ if err == settings.ErrNoSettings && info.Get(c).IsDevAppServer() {
+ log.Infof(c, "Setting up development configuration...")
+
+ if err := gcfg.storeNoValidate(c, "development setup"); err != nil {
+ log.WithError(err).Warningf(c, "Failed to install development global config stub.")
+ }
+ if _, err := getSetupDevConfig(c); err != nil {
+ log.WithError(err).Warningf(c, "Failed to install development configuration entry stub.")
+ }
+ }
+
return nil, err
}
- return &gc, nil
+ return &gcfg, nil
}
// Store stores the new global configuration.
@@ -156,30 +169,6 @@ func (gcfg *GlobalConfig) LoadConfig(c context.Context) (*svcconfig.Config, erro
return &cc, nil
}
-// Load loads the current configuration from "luci-config".
-func Load(c context.Context) (*svcconfig.Config, error) {
- gcfg, err := LoadGlobalConfig(c)
- if err != nil {
- // If we're running the dev appserver, install some configuration stubs so
- // they can be tweaked locally.
- if err == settings.ErrNoSettings {
- if info.Get(c).IsDevAppServer() {
- log.Infof(c, "Setting up development configuration...")
- gcfg = &GlobalConfig{}
- if err := gcfg.storeNoValidate(c, "development setup"); err != nil {
- log.WithError(err).Warningf(c, "Failed to install development global config stub.")
- }
- if _, err := getSetupDevConfig(c); err != nil {
- log.WithError(err).Warningf(c, "Failed to install development configuration entry stub.")
- }
- }
- }
-
- return nil, err
- }
- return gcfg.LoadConfig(c)
-}
-
// validateConfig checks the supplied Coordinator config object to ensure that
// it meets a minimum configuration standard expected by our endpoitns and
// handlers.
« no previous file with comments | « appengine/logdog/coordinator/config/bigTable.go ('k') | appengine/logdog/coordinator/coordinatorTest/archival.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698