diff options
| author | Chris Lu <chrislusf@users.noreply.github.com> | 2020-04-13 22:24:51 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-13 22:24:51 -0700 |
| commit | 23715af402293bd746645bb3ab7104071f93f372 (patch) | |
| tree | f69d5d62b62bb7dac4e5f9379c11e847b743704b | |
| parent | 2b5c4fbbf37e25adfa19b081c4adf5458b05b66c (diff) | |
| parent | b556d3d03595620364781fcc10b5bc509112c400 (diff) | |
| download | seaweedfs-23715af402293bd746645bb3ab7104071f93f372.tar.xz seaweedfs-23715af402293bd746645bb3ab7104071f93f372.zip | |
Merge pull request #1273 from wyxloading/config_race
Fix data race about config
| -rw-r--r-- | weed/util/config.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/weed/util/config.go b/weed/util/config.go index 33809d44d..7b6e92f08 100644 --- a/weed/util/config.go +++ b/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(".", "_")) |
