helper/resource: never use an interval more than 10 seconds on wait

This commit is contained in:
Mitchell Hashimoto 2014-07-14 13:28:48 -07:00
parent 9f96fb4aac
commit f8b974c9aa
1 changed files with 4 additions and 0 deletions

View File

@ -48,6 +48,10 @@ func (conf *StateChangeConf) WaitForState() (i interface{}, err error) {
// Wait between refreshes
wait := time.Duration(math.Pow(2, float64(tries))) *
100 * time.Millisecond
if wait > 10*time.Second {
wait = 10 * time.Second
}
log.Printf("[TRACE] Waiting %s before next try", wait)
time.Sleep(wait)