Skip to content

Commit

Permalink
ProbeState: retry in case of any network error
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavosbarreto committed Jan 31, 2018
1 parent e9648b1 commit e6ea983
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions updatehub/probe_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,15 @@ func (state *ProbeState) Handle(uh *UpdateHub) (State, bool) {
for {
state.probeUpdateMetadata, signature, state.probeExtraPoll, err = uh.Controller.ProbeUpdate(state.apiClient, uh.Settings.PollingRetries)

if neterr, ok := errors.Cause(err).(net.Error); ok && neterr.Timeout() {
log.Warn("timeout during download update")
if neterr, ok := errors.Cause(err).(net.Error); ok {
if neterr.Timeout() {
log.Warn("timeout during download update")
}

uh.Settings.PollingRetries++

time.Sleep(time.Second)

continue
}

Expand Down

0 comments on commit e6ea983

Please sign in to comment.