MCPcopy
hub / github.com/Comfy-Org/ComfyUI-Manager / _ensure_cache

Function _ensure_cache

tests/e2e/test_e2e_git_clone.py:66–79  ·  view source on GitHub ↗

Run cm-cli update-cache (blocking) to populate Manager cache before tests. Timeout is generous (600s): update-cache downloads the full DB lists over the network and routinely exceeds 120s on slow links, which used to fail the whole module at setup.

()

Source from the content-addressed store, hash-verified

64
65
66def _ensure_cache():
67 """Run cm-cli update-cache (blocking) to populate Manager cache before tests.
68
69 Timeout is generous (600s): update-cache downloads the full DB lists
70 over the network and routinely exceeds 120s on slow links, which used
71 to fail the whole module at setup.
72 """
73 env = {**os.environ, "COMFYUI_PATH": COMFYUI_PATH}
74 r = subprocess.run(
75 [_cm_cli_path(), "update-cache"],
76 capture_output=True, text=True, timeout=600, env=env,
77 )
78 if r.returncode != 0:
79 raise RuntimeError(f"update-cache failed:\n{r.stderr}")
80
81
82def _start_comfyui() -> int:

Callers 1

comfyuiFunction · 0.85

Calls 1

_cm_cli_pathFunction · 0.70

Tested by

no test coverage detected