mirror of
https://github.com/Comfy-Org/ComfyUI-Manager.git
synced 2025-12-16 01:57:04 +08:00
fix: prestartup_script.py
- don't forget prestartup_script's config isn't relies on manager_core. they are string not a bool... improve: scanner.py - parallel github_stat scan
This commit is contained in:
parent
c82f80252f
commit
24a4152a9a
2166
github-stats.json
2166
github-stats.json
File diff suppressed because it is too large
Load Diff
@ -23,7 +23,7 @@ sys.path.append(glob_path)
|
||||
import cm_global
|
||||
from manager_util import *
|
||||
|
||||
version = [2, 32, 6]
|
||||
version = [2, 32, 7]
|
||||
version_str = f"V{version[0]}.{version[1]}" + (f'.{version[2]}' if len(version) > 2 else '')
|
||||
|
||||
comfyui_manager_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
|
||||
|
||||
@ -49,7 +49,7 @@ def check_file_logging():
|
||||
config.read(config_path)
|
||||
default_conf = config['default']
|
||||
|
||||
if 'file_logging' in default_conf and not default_conf['file_logging']:
|
||||
if 'file_logging' in default_conf and default_conf['file_logging'].lower() == 'false':
|
||||
enable_file_logging = False
|
||||
except Exception:
|
||||
pass
|
||||
@ -364,7 +364,7 @@ def check_bypass_ssl():
|
||||
config.read(config_path)
|
||||
default_conf = config['default']
|
||||
|
||||
if 'bypass_ssl' in default_conf and default_conf['bypass_ssl']:
|
||||
if 'bypass_ssl' in default_conf and default_conf['bypass_ssl'].lower() == 'true':
|
||||
print(f"[ComfyUI-Manager] WARN: Unsafe - SSL verification bypass option is Enabled. (see ComfyUI-Manager/config.ini)")
|
||||
ssl._create_default_https_context = ssl._create_unverified_context # SSL certificate error fix.
|
||||
except Exception:
|
||||
@ -586,7 +586,7 @@ def check_windows_event_loop_policy():
|
||||
config.read(config_path)
|
||||
default_conf = config['default']
|
||||
|
||||
if 'windows_selector_event_loop_policy' in default_conf and default_conf['windows_selector_event_loop_policy']:
|
||||
if 'windows_selector_event_loop_policy' in default_conf and default_conf['windows_selector_event_loop_policy'].lower() == 'true':
|
||||
try:
|
||||
import asyncio
|
||||
import asyncio.windows_events
|
||||
|
||||
32
scanner.py
32
scanner.py
@ -291,22 +291,34 @@ def update_custom_nodes():
|
||||
repo = g.get_repo(owner_repo)
|
||||
|
||||
last_update = repo.pushed_at.strftime("%Y-%m-%d %H:%M:%S") if repo.pushed_at else 'N/A'
|
||||
github_stats[url] = {
|
||||
item = {
|
||||
"stars": repo.stargazers_count,
|
||||
"last_update": last_update,
|
||||
"cached_time": datetime.datetime.now().timestamp(),
|
||||
}
|
||||
with open(GITHUB_STATS_CACHE_FILENAME, 'w', encoding='utf-8') as file:
|
||||
json.dump(github_stats, file, ensure_ascii=False, indent=4)
|
||||
return url, item
|
||||
else:
|
||||
print(f"\nInvalid URL format for GitHub repository: {url}\n")
|
||||
except Exception as e:
|
||||
print(f"\nERROR on {url}\n{e}")
|
||||
|
||||
return None
|
||||
|
||||
# resolve unresolved urls
|
||||
for url, title, preemptions, node_pattern in git_url_titles_preemptions:
|
||||
if url not in github_stats:
|
||||
renew_stat(url)
|
||||
with concurrent.futures.ThreadPoolExecutor(11) as executor:
|
||||
futures = []
|
||||
for url, title, preemptions, node_pattern in git_url_titles_preemptions:
|
||||
if url not in github_stats:
|
||||
futures.append(executor.submit(renew_stat, url))
|
||||
|
||||
for future in concurrent.futures.as_completed(futures):
|
||||
url_item = future.result()
|
||||
if url_item is not None:
|
||||
url, item = url_item
|
||||
github_stats[url] = item
|
||||
|
||||
with open('github-stats-cache.json', 'w', encoding='utf-8') as file:
|
||||
json.dump(github_stats, file, ensure_ascii=False, indent=4)
|
||||
|
||||
# renew outdated cache
|
||||
outdated_urls = []
|
||||
@ -326,11 +338,11 @@ def update_custom_nodes():
|
||||
json.dump(github_stats, file, ensure_ascii=False, indent=4)
|
||||
|
||||
print(f"Successfully written to {GITHUB_STATS_FILENAME}.")
|
||||
|
||||
with concurrent.futures.ThreadPoolExecutor(11) as executor:
|
||||
if not skip_stat_update:
|
||||
executor.submit(process_git_stats, git_url_titles_preemptions) # One single thread for `process_git_stats()`. Runs concurrently with `process_git_url_title()`.
|
||||
|
||||
if not skip_stat_update:
|
||||
process_git_stats(git_url_titles_preemptions)
|
||||
|
||||
with concurrent.futures.ThreadPoolExecutor(11) as executor:
|
||||
for url, title, preemptions, node_pattern in git_url_titles_preemptions:
|
||||
executor.submit(process_git_url_title, url, title, preemptions, node_pattern)
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user