fix: silent pipeline log and server indexing progress

Three issues caused the Logs view to appear blank during a real pipeline run:

1. `from run import step_fetch, step_link` was outside the worker's
   try/except/finally. An import failure silently killed the thread,
   leaving _pipeline_done uncalled and the Run button stuck disabled
   forever. Now wrapped in its own try/except that posts the error to
   the log and resets the UI.

2. `build_server_index` makes N sequential HTTP requests (one per mod
   folder's meta.cpp) with no output during the scan. Added an optional
   `progress_fn(current, total, name)` callback; step_fetch wires it to
   print progress every 25 folders so the log never goes silent.

3. No immediate feedback after clicking Start — the log was blank until
   the worker thread started printing. Now posts a "Pipeline started"
   banner from the main thread before the worker launches.
This commit is contained in:
Tran G. (Revernomad) Khoa
2026-04-08 23:35:26 +07:00
parent e0c2dfb32a
commit 3276f4b63f
5 changed files with 38 additions and 5 deletions

9
run.py
View File

@@ -91,9 +91,14 @@ def step_fetch(cfg) -> None:
for mod in data["mods"]:
queue.append((mod, preset_name))
def _index_progress(current: int, total: int, name: str) -> None:
if current == 1 or current % 25 == 0 or current == total:
print(f" Indexing {current}/{total}: {name}")
print(f" Building server index...")
index = build_server_index(cfg.server_url, cfg.server_auth)
print(f" Indexed {len(index['by_steam_id'])} mods\n")
index = build_server_index(cfg.server_url, cfg.server_auth, progress_fn=_index_progress)
print(f" Indexed {len(index['by_steam_id'])} mods by steam_id, "
f"{len(index['by_name'])} by name\n")
session = make_session(cfg.server_auth)
resolved = []