Added support for ROUTE53_MAX_RETRIES env var option

This commit is contained in:
janeczku
2017-10-25 20:38:16 +02:00
committed by Denise
parent e1060a0614
commit ba0b3fa196
+10
View File
@@ -3,6 +3,7 @@ package route53
import (
"fmt"
"os"
"strconv"
"strings"
"github.com/Sirupsen/logrus"
@@ -41,6 +42,15 @@ func (r *Route53Provider) Init(rootDomainName string) error {
// requests automatically if the global rate limit is exhausted.
r.limiter = ratelimit.NewBucketWithRate(5.0, 1)
if envVal := os.Getenv("ROUTE53_MAX_RETRIES"); envVal != "" {
i, err := strconv.Atoi(envVal)
if err == nil {
route53MaxRetries = i
} else {
logrus.Warnf("Invalid value for ROUTE53_MAX_RETRIES. Using default.")
}
}
creds := credentials.NewChainCredentials(
[]credentials.Provider{
&credentials.EnvProvider{},