|
|
@@ -846,7 +846,12 @@ func (az *Azure) DownloadPricingData() error {
|
|
|
rateCardFilter := fmt.Sprintf("OfferDurableId eq '%s' and Currency eq '%s' and Locale eq 'en-US' and RegionInfo eq '%s'", config.AzureOfferDurableID, config.CurrencyCode, config.AzureBillingRegion)
|
|
|
|
|
|
log.Infof("Using ratecard query %s", rateCardFilter)
|
|
|
- result, err := rcClient.Get(context.TODO(), rateCardFilter)
|
|
|
+ // rate-card client is old, it can hang indefinitely in some cases
|
|
|
+ // this happens on the main thread, so it may block the whole app
|
|
|
+ // there is can be a better way to set timeout for the client
|
|
|
+ ctx, cancel := context.WithTimeout(context.TODO(), 60*time.Second)
|
|
|
+ defer cancel()
|
|
|
+ result, err := rcClient.Get(ctx, rateCardFilter)
|
|
|
if err != nil {
|
|
|
log.Warnf("Error in pricing download query from API")
|
|
|
az.rateCardPricingError = err
|