Browse Source
Merge pull request #1273 from wyxloading/config_race
Fix data race about config
pull/1278/head
Chris Lu
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
2 additions and
1 deletions
-
weed/util/config.go
|
|
@ -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(".", "_")) |
|
|
|