mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-20 10:20:51 +00:00
Merge pull request #514 from brendandburns/fix
Insert a couple of sleeps to slow things down.
This commit is contained in:
commit
7d0b8e0c1c
@ -76,14 +76,17 @@ func (s ConfigSourceFile) Run() {
|
||||
var lastServices []api.Service
|
||||
var lastEndpoints []api.Endpoints
|
||||
|
||||
sleep := 5 * time.Second
|
||||
for {
|
||||
data, err := ioutil.ReadFile(s.filename)
|
||||
if err != nil {
|
||||
glog.Errorf("Couldn't read file: %s : %v", s.filename, err)
|
||||
time.Sleep(sleep)
|
||||
continue
|
||||
}
|
||||
|
||||
if bytes.Equal(lastData, data) {
|
||||
time.Sleep(sleep)
|
||||
continue
|
||||
}
|
||||
lastData = data
|
||||
@ -112,6 +115,6 @@ func (s ConfigSourceFile) Run() {
|
||||
lastEndpoints = newEndpoints
|
||||
}
|
||||
|
||||
time.Sleep(5 * time.Second)
|
||||
time.Sleep(sleep)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user