github.com/altoros/juju-vmware@v0.0.0-20150312064031-f19ae857ccca/provider/common/polling.go (about)

     1  // Copyright 2013 Canonical Ltd.
     2  // Licensed under the AGPLv3, see LICENCE file for details.
     3  
     4  package common
     5  
     6  import (
     7  	"time"
     8  
     9  	"github.com/juju/utils"
    10  )
    11  
    12  // Use ShortAttempt to poll for short-term events.
    13  // TODO: This may need tuning for different providers (or even environments).
    14  var ShortAttempt = utils.AttemptStrategy{
    15  	Total: 5 * time.Second,
    16  	Delay: 200 * time.Millisecond,
    17  }
    18  
    19  // A request may fail to due "eventual consistency" semantics, which
    20  // should resolve fairly quickly.  These delays are specific to the provider
    21  // and best tuned there.
    22  // Other requests fail due to a slow state transition (e.g. an instance taking
    23  // a while to release a security group after termination).  If you need to
    24  // poll for the latter kind, use LongAttempt.
    25  var LongAttempt = utils.AttemptStrategy{
    26  	Total: 3 * time.Minute,
    27  	Delay: 1 * time.Second,
    28  }