mirror of
https://github.com/Comfy-Org/ComfyUI-Manager.git
synced 2026-01-28 15:00:19 +08:00
Merge 742960dde5 into 29a59595b9
This commit is contained in:
commit
467d8ef74a
@ -25,7 +25,7 @@ async def get_cnr_data(cache_mode=True, dont_wait=True):
|
|||||||
print("A timeout occurred during the fetch process from ComfyRegistry.")
|
print("A timeout occurred during the fetch process from ComfyRegistry.")
|
||||||
return await _get_cnr_data(cache_mode=True, dont_wait=True) # timeout fallback
|
return await _get_cnr_data(cache_mode=True, dont_wait=True) # timeout fallback
|
||||||
|
|
||||||
async def _get_cnr_data(cache_mode=True, dont_wait=True):
|
async def _get_cnr_data(cache_mode=True, dont_wait=True, silent=True):
|
||||||
global is_cache_loading
|
global is_cache_loading
|
||||||
|
|
||||||
uri = f'{base_url}/nodes'
|
uri = f'{base_url}/nodes'
|
||||||
@ -78,12 +78,14 @@ async def _get_cnr_data(cache_mode=True, dont_wait=True):
|
|||||||
full_nodes[x['id']] = x
|
full_nodes[x['id']] = x
|
||||||
|
|
||||||
if page % 5 == 0:
|
if page % 5 == 0:
|
||||||
print(f"FETCH ComfyRegistry Data: {page}/{sub_json_obj['totalPages']}")
|
if not silent:
|
||||||
|
print(f"FETCH ComfyRegistry Data: {page}/{sub_json_obj['totalPages']}")
|
||||||
|
|
||||||
page += 1
|
page += 1
|
||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
|
|
||||||
print("FETCH ComfyRegistry Data [DONE]")
|
if not silent:
|
||||||
|
print("FETCH ComfyRegistry Data [DONE]")
|
||||||
|
|
||||||
for v in full_nodes.values():
|
for v in full_nodes.values():
|
||||||
if 'latest_version' not in v:
|
if 'latest_version' not in v:
|
||||||
|
|||||||
@ -178,7 +178,7 @@ def is_file_created_within_one_day(file_path):
|
|||||||
return time_difference <= 86400
|
return time_difference <= 86400
|
||||||
|
|
||||||
|
|
||||||
async def get_data(uri, silent=False):
|
async def get_data(uri, silent=True):
|
||||||
if not silent:
|
if not silent:
|
||||||
print(f"FETCH DATA from: {uri}", end="")
|
print(f"FETCH DATA from: {uri}", end="")
|
||||||
|
|
||||||
@ -225,7 +225,7 @@ def get_cache_state(uri):
|
|||||||
return "expired"
|
return "expired"
|
||||||
|
|
||||||
|
|
||||||
def save_to_cache(uri, json_obj, silent=False):
|
def save_to_cache(uri, json_obj, silent=True):
|
||||||
cache_uri = get_cache_path(uri)
|
cache_uri = get_cache_path(uri)
|
||||||
|
|
||||||
with cache_lock:
|
with cache_lock:
|
||||||
@ -235,7 +235,7 @@ def save_to_cache(uri, json_obj, silent=False):
|
|||||||
logging.info(f"[ComfyUI-Manager] default cache updated: {uri}")
|
logging.info(f"[ComfyUI-Manager] default cache updated: {uri}")
|
||||||
|
|
||||||
|
|
||||||
async def get_data_with_cache(uri, silent=False, cache_mode=True, dont_wait=False, dont_cache=False):
|
async def get_data_with_cache(uri, silent=True, cache_mode=True, dont_wait=False, dont_cache=False):
|
||||||
cache_uri = get_cache_path(uri)
|
cache_uri = get_cache_path(uri)
|
||||||
|
|
||||||
if cache_mode and dont_wait:
|
if cache_mode and dont_wait:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user