Skip to content

Commit

Permalink
Merge pull request #939 from openshift-cherrypick-robot/cherry-pick-9…
Browse files Browse the repository at this point in the history
…12-to-release-4.12

[release-4.12] OCPBUGS-22125: increase storage account key cache expiration
  • Loading branch information
openshift-merge-bot[bot] committed Nov 30, 2023
2 parents 3062522 + 7e844f1 commit 0e04e37
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/storage/azure/cached_key.go
Expand Up @@ -10,6 +10,9 @@ import (
"github.com/openshift/cluster-image-registry-operator/pkg/metrics"
)

// cacheExpiration is the cache expiration duration in minutes.
const cacheExpiration time.Duration = 20 * time.Minute

// primaryKey keeps account primary key in a cache.
var primaryKey cachedKey

Expand Down Expand Up @@ -44,6 +47,6 @@ func (k *cachedKey) get(
k.resourceGroup = resourceGroup
k.account = account
k.value = *(*keysResponse.Keys)[0].Value
k.expire = time.Now().Add(5 * time.Minute)
k.expire = time.Now().Add(cacheExpiration)
return k.value, nil
}

0 comments on commit 0e04e37

Please sign in to comment.