Skip to content

Commit a566b5a

Browse files
flavianmissiopenshift-cherrypick-robot
authored andcommitted
pkg/storage/azure: increase storage account key cache expiration
make it 20 minutes instead of 5. Azure has an api limit for storage account list (which apparently listing keys uses behind the scenes) of 100 calls / 5 minutes. if a project has a lot of clusters, this limit might be hit.
1 parent 3ed61e2 commit a566b5a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pkg/storage/azure/cached_key.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ import (
1010
"github.com/openshift/cluster-image-registry-operator/pkg/metrics"
1111
)
1212

13+
// cacheExpiration is the cache expiration duration in minutes.
14+
const cacheExpiration time.Duration = 20 * time.Minute
15+
1316
// primaryKey keeps account primary key in a cache.
1417
var primaryKey cachedKey
1518

@@ -44,6 +47,6 @@ func (k *cachedKey) get(
4447
k.resourceGroup = resourceGroup
4548
k.account = account
4649
k.value = *(*keysResponse.Keys)[0].Value
47-
k.expire = time.Now().Add(5 * time.Minute)
50+
k.expire = time.Now().Add(cacheExpiration)
4851
return k.value, nil
4952
}

0 commit comments

Comments
 (0)