File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -114,7 +114,7 @@ def query(
114114 if self .auto_reload and (
115115 self .loaded_at is None or time .monotonic () - self .loaded_at > RELOAD_INTERVAL
116116 ):
117- self .load ()
117+ self ._load ()
118118
119119 query_filter = QueryFilter (
120120 provider = [provider ] if isinstance (provider , str ) else provider ,
@@ -183,11 +183,15 @@ def query(
183183
184184 def load (self , version : Optional [str ] = None ):
185185 """
186- Fetch the catalog from the S3 bucket
186+ Fetch the catalog from the S3 bucket. Thread-safe.
187187
188188 Args:
189189 version: specific version of the catalog to download. If not specified, the latest version will be used
190190 """
191+ with self ._load_lock :
192+ self ._load (version )
193+
194+ def _load (self , version : Optional [str ] = None ):
191195 catalog_url = os .getenv ("GPUHUNT_CATALOG_URL" )
192196 if catalog_url is None :
193197 if version is None :
You can’t perform that action at this time.
0 commit comments