MCPcopy Create free account
hub / github.com/Graphify-Labs/graphify / _skill_lock_path

Function _skill_lock_path

graphify/install.py:50–62  ·  view source on GitHub ↗

The lock file for ``skill_dir``, kept out of the skill directory. Inside it, a project-scope install would leave the file in the user's repository, and uninstall would have to delete a file another process may still hold - letting that process and a new one both own the lock.

(skill_dir: Path)

Source from the content-addressed store, hash-verified

48
49
50def _skill_lock_path(skill_dir: Path) -> Path:
51 """The lock file for ``skill_dir``, kept out of the skill directory.
52
53 Inside it, a project-scope install would leave the file in the user's
54 repository, and uninstall would have to delete a file another process may
55 still hold - letting that process and a new one both own the lock.
56 """
57 try:
58 real = skill_dir.resolve()
59 except (OSError, RuntimeError): # symlink loop
60 real = skill_dir.absolute()
61 digest = hashlib.sha256(os.path.normcase(str(real)).encode("utf-8")).hexdigest()[:16]
62 return Path.home() / ".cache" / "graphify" / "skill-locks" / f"{digest}.lock"
63
64
65# Lock files this thread holds: the CLI's refresh takes the lock and then calls

Callers 1

_skill_lockFunction · 0.85

Calls 1

resolveMethod · 0.45

Tested by

no test coverage detected