Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Extension Update Checks Multi-Threaded #2110

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion modules/ui_extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def check_updates(id_task, disable_list):
exts = [ext for ext in extensions.extensions if ext.remote is not None and ext.name not in disabled]
shared.state.job_count = len(exts)

for ext in exts:
def _check_update(ext):
shared.state.textinfo = ext.name

try:
Expand All @@ -117,6 +117,14 @@ def check_updates(id_task, disable_list):
except Exception:
errors.report(f"Error checking updates for {ext.name}", exc_info=True)

threads = []
for ext in exts:
thread = threading.Thread(target=_check_update, args=(ext,))
threads.append(thread)
thread.start()

for thread in threads:
thread.join()
shared.state.nextjob()

return extension_table(), ""
Expand Down