Skip to content

Instantly share code, notes, and snippets.

@gavrie
Created May 17, 2016 12:32
Show Gist options
  • Save gavrie/167ec6e351753bdfeda83bb351dd09e0 to your computer and use it in GitHub Desktop.
Save gavrie/167ec6e351753bdfeda83bb351dd09e0 to your computer and use it in GitHub Desktop.
func (er *exponentialRetrier) nextTimeout() time.Duration {
er.retries--
t := er.timeout
er.timeout *= 2
log.Printf("Next timeout: %v\n", t)
return t
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment