func()

in src/sdkutil/retryer/retryer.go [32:43]


func (s SsmCliRetryer) RetryRules(r *request.Request) time.Duration {
	// Handle GetMessages Client.Timeout error
	if r.Operation.Name == "GetMessages" && r.Error != nil && strings.Contains(r.Error.Error(), "Client.Timeout") {
		// expected error. we will retry with a short 100 ms delay
		return time.Duration(100 * time.Millisecond)
	}

	// retry after a > 1 sec timeout, increasing exponentially with each retry
	rand.Seed(time.Now().UnixNano())
	delay := int(math.Pow(2, float64(r.RetryCount))) * (rand.Intn(500) + 1000)
	return time.Duration(delay) * time.Millisecond
}