mirror of
https://github.com/spf13/viper
synced 2024-11-16 18:07:02 +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
2
viper.go
2
viper.go
|
@ -1903,8 +1903,10 @@ func (v *Viper) watchKeyValueConfigOnChannel(run func()) error {
|
|||
b := <-rc
|
||||
reader := bytes.NewReader(b.Value)
|
||||
v.unmarshalReader(reader, v.kvstore)
|
||||
if b.Error == nil {
|
||||
run()
|
||||
}
|
||||
}
|
||||
}(respc)
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue