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
4
viper.go
4
viper.go
|
@ -1903,7 +1903,9 @@ func (v *Viper) watchKeyValueConfigOnChannel(run func()) error {
|
||||||
b := <-rc
|
b := <-rc
|
||||||
reader := bytes.NewReader(b.Value)
|
reader := bytes.NewReader(b.Value)
|
||||||
v.unmarshalReader(reader, v.kvstore)
|
v.unmarshalReader(reader, v.kvstore)
|
||||||
run()
|
if b.Error == nil {
|
||||||
|
run()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}(respc)
|
}(respc)
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Reference in a new issue