mirror of
https://github.com/spf13/viper
synced 2025-01-08 11:46:36 +00:00
fix watchKeyValueConfigOnChannel panic when remote config update
This commit is contained in:
parent
5d65186f1e
commit
104f9d0771
1 changed files with 3 additions and 1 deletions
4
viper.go
4
viper.go
|
@ -1882,7 +1882,9 @@ func (v *Viper) watchKeyValueConfigOnChannel() error {
|
||||||
for {
|
for {
|
||||||
b := <-rc
|
b := <-rc
|
||||||
reader := bytes.NewReader(b.Value)
|
reader := bytes.NewReader(b.Value)
|
||||||
v.unmarshalReader(reader, v.kvstore)
|
kvstore := make(map[string]interface{})
|
||||||
|
v.unmarshalReader(reader, kvstore)
|
||||||
|
v.kvstore = kvstore
|
||||||
}
|
}
|
||||||
}(respc)
|
}(respc)
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Reference in a new issue