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:
9
run.py
9
run.py
@@ -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 = []
|
||||
|
||||
Reference in New Issue
Block a user