From 3274885803f8daa52dcf3b8fe35beae0f948f5c8 Mon Sep 17 00:00:00 2001 From: "Dr.Lt.Data" Date: Sun, 19 Jan 2025 02:41:38 +0900 Subject: [PATCH] * FIXED: cm-cli.py - mode doesn't work * FIXED: get_cnr_data - use timeout fallback --- cm-cli.py | 2 +- glob/cnr_utils.py | 9 ++++++++- glob/manager_core.py | 2 +- pyproject.toml | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/cm-cli.py b/cm-cli.py index 06ecb1df..c85599ea 100644 --- a/cm-cli.py +++ b/cm-cli.py @@ -118,7 +118,7 @@ class Ctx: if channel is not None: self.channel = channel - asyncio.run(unified_manager.reload(cache_mode=self.mode == 'cache', dont_wait=False)) + asyncio.run(unified_manager.reload(cache_mode=self.mode, dont_wait=False)) asyncio.run(unified_manager.load_nightly(self.channel, self.mode)) def set_no_deps(self, no_deps): diff --git a/glob/cnr_utils.py b/glob/cnr_utils.py index 7ee6a906..4aec3a46 100644 --- a/glob/cnr_utils.py +++ b/glob/cnr_utils.py @@ -15,6 +15,13 @@ lock = asyncio.Lock() is_cache_loading = False async def get_cnr_data(cache_mode=True, dont_wait=True): + try: + return await _get_cnr_data(cache_mode, dont_wait) + except asyncio.TimeoutError: + print(f"A timeout occurred during the fetch process from ComfyRegistry.") + return await _get_cnr_data(cache_mode=True, dont_wait=True) # timeout fallback + +async def _get_cnr_data(cache_mode=True, dont_wait=True): global is_cache_loading uri = f'{base_url}/nodes' @@ -26,7 +33,7 @@ async def get_cnr_data(cache_mode=True, dont_wait=True): full_nodes = {} while remained: sub_uri = f'{base_url}/nodes?page={page}&limit=30' - sub_json_obj = await manager_util.get_data_with_cache(sub_uri, cache_mode=False, silent=True) + sub_json_obj = await asyncio.wait_for(manager_util.get_data_with_cache(sub_uri, cache_mode=False, silent=True), timeout=10) remained = page < sub_json_obj['totalPages'] for x in sub_json_obj['nodes']: diff --git a/glob/manager_core.py b/glob/manager_core.py index d6d18046..861623c9 100644 --- a/glob/manager_core.py +++ b/glob/manager_core.py @@ -41,7 +41,7 @@ import manager_downloader from node_package import InstalledNodePackage -version_code = [3, 9] +version_code = [3, 9, 1] version_str = f"V{version_code[0]}.{version_code[1]}" + (f'.{version_code[2]}' if len(version_code) > 2 else '') diff --git a/pyproject.toml b/pyproject.toml index 972311c5..fd932ac5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "comfyui-manager" description = "ComfyUI-Manager provides features to install and manage custom nodes for ComfyUI, as well as various functionalities to assist with ComfyUI." -version = "3.9" +version = "3.9.1" license = { file = "LICENSE.txt" } dependencies = ["GitPython", "PyGithub", "matrix-client==0.4.0", "transformers", "huggingface-hub>0.20", "typer", "rich", "typing-extensions"]