diff --git a/internal/app/cloudinfo/cistore/go-cache.go b/internal/app/cloudinfo/cistore/go-cache.go index 6b57cd22f..53a9a1238 100644 --- a/internal/app/cloudinfo/cistore/go-cache.go +++ b/internal/app/cloudinfo/cistore/go-cache.go @@ -159,7 +159,9 @@ func (cis *cacheProductStore) DeleteVm(provider, service, region string) { } func (cis *cacheProductStore) StoreServices(provider string, services []types.Service) { - cis.Set(cis.getKey(cloudinfo.ServicesKeyTemplate, provider), services, cis.itemExpiry) + // Service info never expires hence -1 expiry. + // With expiry set cache doesn't get repopulated because service info is the basic info that is always required + cis.Set(cis.getKey(cloudinfo.ServicesKeyTemplate, provider), services, -1) } func (cis *cacheProductStore) GetServices(provider string) ([]types.Service, bool) { diff --git a/internal/cloudinfo/providers/azure/cloudinfo.go b/internal/cloudinfo/providers/azure/cloudinfo.go index 0db9b9244..d14b54b78 100644 --- a/internal/cloudinfo/providers/azure/cloudinfo.go +++ b/internal/cloudinfo/providers/azure/cloudinfo.go @@ -20,6 +20,7 @@ import ( "regexp" "strconv" "strings" + "time" "emperror.dev/emperror" "emperror.dev/errors" @@ -209,7 +210,11 @@ func (a *AzureInfoer) Initialize() (map[string]map[string]types.Price, error) { } rateCardFilter := "OfferDurableId eq 'MS-AZR-0003p' and Currency eq 'USD' and Locale eq 'en-US' and RegionInfo eq 'US'" + // ResourceRateCardInfo is a huge object, it takes around 3-5 minutes to fetch this + startTime := time.Now() + a.log.Info("Fetching Azure ResourceRateCardInfo") result, err := a.rateCardClient.Get(context.TODO(), rateCardFilter) + a.log.Info("Fetched Azure ResourceRateCardInfo", map[string]interface{}{"minutesTaken": time.Since(startTime).Minutes()}) if err != nil { return nil, err } diff --git a/version b/version index 509888c1b..b423eb505 100644 --- a/version +++ b/version @@ -1 +1 @@ -version=1.0.10400 +version=1.0.10401