mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
Merge pull request #1273 from wyxloading/config_race
Fix data race about config
This commit is contained in:
commit
23715af402
|
@ -42,7 +42,8 @@ func LoadConfiguration(configFileName string, required bool) (loaded bool) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetViper() *viper.Viper {
|
func GetViper() *viper.Viper {
|
||||||
v := viper.GetViper()
|
v := &viper.Viper{}
|
||||||
|
*v = *viper.GetViper()
|
||||||
v.AutomaticEnv()
|
v.AutomaticEnv()
|
||||||
v.SetEnvPrefix("weed")
|
v.SetEnvPrefix("weed")
|
||||||
v.SetEnvKeyReplacer(strings.NewReplacer(".", "_"))
|
v.SetEnvKeyReplacer(strings.NewReplacer(".", "_"))
|
||||||
|
|
Loading…
Reference in a new issue