Skip to content

Commit e71b854

Browse files
Merge pull request #940 from openshift-cherrypick-robot/cherry-pick-912-to-release-4.13
[release-4.13] OCPBUGS-22126: increase storage account key cache expiration
2 parents ae60ba7 + a566b5a commit e71b854

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)