MCPcopy Create free account
hub / github.com/FastLED/FastLED / is_artifact_locked

Function is_artifact_locked

ci/util/cache_lock.py:205–231  ·  view source on GitHub ↗

Check if an artifact is currently locked. Args: cache_dir: Global cache directory url: URL to check Returns: True if artifact is locked by an active process, False otherwise

(cache_dir: Path, url: str)

Source from the content-addressed store, hash-verified

203
204
205def is_artifact_locked(cache_dir: Path, url: str) -> bool:
206 """
207 Check if an artifact is currently locked.
208
209 Args:
210 cache_dir: Global cache directory
211 url: URL to check
212
213 Returns:
214 True if artifact is locked by an active process, False otherwise
215 """
216 cache_key = str(sanitize_url_for_path(url))
217 artifact_dir = cache_dir / cache_key
218 lock_file = artifact_dir / ".download.lock"
219
220 db = get_lock_database(lock_file)
221 lock_name = str(lock_file)
222
223 # Check if held in database
224 if not db.is_held(lock_name):
225 return False
226
227 # Check if it's stale
228 if db.is_lock_stale(lock_name):
229 return False
230
231 return True

Calls 4

sanitize_url_for_pathFunction · 0.90
get_lock_databaseFunction · 0.90
is_heldMethod · 0.80
is_lock_staleMethod · 0.80