1
0
Fork 0
mirror of https://github.com/chrislusf/seaweedfs synced 2024-07-01 22:56:38 +02:00

Fix data race about config

This commit is contained in:
wuyuxiang 2020-04-14 10:22:40 +08:00
parent d8f5985e5e
commit b556d3d035

View file

@ -42,7 +42,8 @@ func LoadConfiguration(configFileName string, required bool) (loaded bool) {
}
func GetViper() *viper.Viper {
v := viper.GetViper()
v := &viper.Viper{}
*v = *viper.GetViper()
v.AutomaticEnv()
v.SetEnvPrefix("weed")
v.SetEnvKeyReplacer(strings.NewReplacer(".", "_"))