Skip to content

Commit 6a51a6b

Browse files
committed
shorten the cache on DescribeInstanceStatus since this is used to wait to act
1 parent 5e25dda commit 6a51a6b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

internal/aws/albsession/session.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import (
77
"github.com/aws/aws-sdk-go/aws"
88
"github.com/aws/aws-sdk-go/aws/request"
99
"github.com/aws/aws-sdk-go/aws/session"
10+
"github.com/aws/aws-sdk-go/service/ec2"
11+
"github.com/aws/aws-sdk-go/service/resourcegroupstaggingapi"
1012
"github.com/golang/glog"
1113
"github.com/kubernetes-sigs/aws-alb-ingress-controller/internal/ingress/metric"
1214
"github.com/kubernetes-sigs/aws-alb-ingress-controller/pkg/util/log"
@@ -25,7 +27,8 @@ func NewSession(awsconfig *aws.Config, AWSDebug bool, mc metric.Collector, cc *c
2527

2628
// Adds caching to session
2729
cache.AddCaching(session, cc)
28-
cc.SetCacheTTL("tagging", "GetResources", time.Hour)
30+
cc.SetCacheTTL(resourcegroupstaggingapi.ServiceName, "GetResources", time.Hour)
31+
cc.SetCacheTTL(ec2.ServiceName, "DescribeInstanceStatus", time.Minute)
2932

3033
session.Handlers.Retry.PushFront(func(r *request.Request) {
3134
mc.IncAPIRetryCount(prometheus.Labels{"service": r.ClientInfo.ServiceName, "operation": r.Operation.Name})

0 commit comments

Comments
 (0)