@@ -119,7 +119,7 @@ class AWSCompute(
119119 def __init__ (
120120 self ,
121121 config : AWSConfig ,
122- quotas_cache : Optional [AWSQuotasCache ] = None ,
122+ quotas_cache : Optional [ComputeTTLCache ] = None ,
123123 zones_cache : Optional [ComputeCache ] = None ,
124124 ):
125125 super ().__init__ ()
@@ -136,7 +136,7 @@ def __init__(
136136 # with more aggressive/longer caches.
137137 self ._offers_post_filter_cache = ComputeTTLCache (cache = TTLCache (maxsize = 10 , ttl = 180 ))
138138 if quotas_cache is None :
139- quotas_cache = AWSQuotasCache (cache = TTLCache (maxsize = 10 , ttl = 600 ))
139+ quotas_cache = ComputeTTLCache (cache = TTLCache (maxsize = 10 , ttl = 600 ))
140140 self ._regions_to_quotas_cache = quotas_cache
141141 if zones_cache is None :
142142 zones_cache = ComputeCache (cache = Cache (maxsize = 10 ))
@@ -154,10 +154,7 @@ def get_all_offers_with_availability(self) -> List[InstanceOfferWithAvailability
154154 extra_filter = _supported_instances ,
155155 )
156156 regions = list (set (i .region for i in offers ))
157- with self ._regions_to_quotas_cache .execution_lock :
158- # Cache lock does not prevent concurrent execution.
159- # We use a separate lock to avoid requesting quotas in parallel and hitting rate limits.
160- regions_to_quotas = self ._get_regions_to_quotas (self .session , regions )
157+ regions_to_quotas = self ._get_regions_to_quotas (self .session , regions )
161158 regions_to_zones = self ._get_regions_to_zones (self .session , regions )
162159
163160 availability_offers = []
0 commit comments