mirror of
https://github.com/spf13/viper
synced 2024-12-23 03:57:01 +00:00
fix: when remote watch fails, the callback should not be called
This commit is contained in:
parent
7ba3455b88
commit
0f246792b8
1 changed files with 3 additions and 1 deletions
4
viper.go
4
viper.go
|
@ -1903,7 +1903,9 @@ func (v *Viper) watchKeyValueConfigOnChannel(run func()) error {
|
|||
b := <-rc
|
||||
reader := bytes.NewReader(b.Value)
|
||||
v.unmarshalReader(reader, v.kvstore)
|
||||
run()
|
||||
if b.Error == nil {
|
||||
run()
|
||||
}
|
||||
}
|
||||
}(respc)
|
||||
return nil
|
||||
|
|
Loading…
Reference in a new issue