Skip to content

Commit 69ce1a0

Browse files
committed
fixed: Bug fix in glob/manager_server.py that prevented cache updates when installed via pip.
Until the cacheless implementation is fully applied, the cache must always be updated — otherwise, various parts of the system will malfunction.
1 parent 1ab2b1a commit 69ce1a0

File tree

3 files changed

+8
-11
lines changed

3 files changed

+8
-11
lines changed

comfyui_manager/common/cnr_utils.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
import requests
1313
import toml
14+
import logging
1415

1516
base_url = "https://api.comfy.org"
1617

@@ -23,7 +24,7 @@ async def get_cnr_data(cache_mode=True, dont_wait=True):
2324
try:
2425
return await _get_cnr_data(cache_mode, dont_wait)
2526
except asyncio.TimeoutError:
26-
print("A timeout occurred during the fetch process from ComfyRegistry.")
27+
logging.info("A timeout occurred during the fetch process from ComfyRegistry.")
2728
return await _get_cnr_data(cache_mode=True, dont_wait=True) # timeout fallback
2829

2930
async def _get_cnr_data(cache_mode=True, dont_wait=True):
@@ -79,12 +80,12 @@ async def fetch_all():
7980
full_nodes[x['id']] = x
8081

8182
if page % 5 == 0:
82-
print(f"FETCH ComfyRegistry Data: {page}/{sub_json_obj['totalPages']}")
83+
logging.info(f"FETCH ComfyRegistry Data: {page}/{sub_json_obj['totalPages']}")
8384

8485
page += 1
8586
time.sleep(0.5)
8687

87-
print("FETCH ComfyRegistry Data [DONE]")
88+
logging.info("FETCH ComfyRegistry Data [DONE]")
8889

8990
for v in full_nodes.values():
9091
if 'latest_version' not in v:
@@ -100,7 +101,7 @@ async def fetch_all():
100101
if cache_state == 'not-cached':
101102
return {}
102103
else:
103-
print("[ComfyUI-Manager] The ComfyRegistry cache update is still in progress, so an outdated cache is being used.")
104+
logging.info("[ComfyUI-Manager] The ComfyRegistry cache update is still in progress, so an outdated cache is being used.")
104105
with open(manager_util.get_cache_path(uri), 'r', encoding="UTF-8", errors="ignore") as json_file:
105106
return json.load(json_file)['nodes']
106107

@@ -114,7 +115,7 @@ async def fetch_all():
114115
return json_obj['nodes']
115116
except Exception:
116117
res = {}
117-
print("Cannot connect to comfyregistry.")
118+
logging.warning("Cannot connect to comfyregistry.")
118119
finally:
119120
if cache_mode:
120121
is_cache_loading = False
@@ -240,7 +241,7 @@ def generate_cnr_id(fullpath, cnr_id):
240241
with open(cnr_id_path, "w") as f:
241242
return f.write(cnr_id)
242243
except Exception:
243-
print(f"[ComfyUI Manager] unable to create file: {cnr_id_path}")
244+
logging.error(f"[ComfyUI Manager] unable to create file: {cnr_id_path}")
244245

245246

246247
def read_cnr_id(fullpath):

comfyui_manager/glob/manager_core.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1003,7 +1003,6 @@ def unified_enable(self, node_id: str, version_spec=None):
10031003
"""
10041004

10051005
result = ManagedResult('enable')
1006-
10071006
if 'comfyui-manager' in node_id.lower():
10081007
return result.fail(f"ignored: enabling '{node_id}'")
10091008

comfyui_manager/glob/manager_server.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2045,10 +2045,7 @@ async def get_cache(filename):
20452045
)
20462046
traceback.print_exc()
20472047

2048-
if (
2049-
core.get_config()["network_mode"] != "offline"
2050-
and not manager_util.is_manager_pip_package()
2051-
):
2048+
if core.get_config()["network_mode"] != "offline":
20522049
a = get_cache("custom-node-list.json")
20532050
b = get_cache("extension-node-map.json")
20542051
c = get_cache("model-list.json")

0 commit comments

Comments
 (0)