make sure we can correctly save the config file if onboarding influx.

pull/228/head
Jason Kulatunga 2 years ago
parent fabc629e40
commit 5bab9ac04a

@ -104,6 +104,8 @@ func (c *configuration) ReadConfig(configFilePath string) error {
if err != nil { if err != nil {
return err return err
} }
//make sure that we specify that this is the correct config path (for eventual WriteConfig() calls)
c.SetConfigFile(configFilePath)
return c.ValidateConfig() return c.ValidateConfig()
} }

@ -101,8 +101,10 @@ func NewScrutinyRepository(appConfig config.Interface, globalLogger logrus.Field
appConfig.Set("web.influxdb.token", *onboardingResponse.Auth.Token) appConfig.Set("web.influxdb.token", *onboardingResponse.Auth.Token)
// we should write the config file out here. Ignore failures. // we should write the config file out here. Ignore failures.
_ = appConfig.WriteConfig() err = appConfig.WriteConfig()
if err != nil {
globalLogger.Infof("ignoring error while writing influxdb info to config: %v", err)
}
} }
// Use blocking write client for writes to desired bucket // Use blocking write client for writes to desired bucket

Loading…
Cancel
Save