From f8b974c9aaff7dcbd175148fa162584ebb5c76fb Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Mon, 14 Jul 2014 13:28:48 -0700 Subject: [PATCH] helper/resource: never use an interval more than 10 seconds on wait --- helper/resource/wait.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/helper/resource/wait.go b/helper/resource/wait.go index 3ca915562c..cc5c505ad4 100644 --- a/helper/resource/wait.go +++ b/helper/resource/wait.go @@ -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)