From 08fe87c8af3061cfb463af323cf8ead28c4d57da Mon Sep 17 00:00:00 2001 From: bennykok Date: Fri, 9 Feb 2024 22:13:25 +0800 Subject: [PATCH] fix(plugin): cached execution progress update --- custom_routes.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/custom_routes.py b/custom_routes.py index 33ae803..190ccce 100644 --- a/custom_routes.py +++ b/custom_routes.py @@ -376,6 +376,16 @@ async def send_json_override(self, event, data, sid=None): print("updating run live status", class_type) await update_run_live_status(prompt_id, "Executing " + class_type, calculated_progress) + if event == 'execution_cached' and data.get('nodes') is not None: + if prompt_id in prompt_metadata: + if 'progress' not in prompt_metadata[prompt_id]: + prompt_metadata[prompt_id]["progress"] = set() + + if 'nodes' in data: + for node in data.get('nodes', []): + prompt_metadata[prompt_id]["progress"].add(node) + # prompt_metadata[prompt_id]["progress"].update(data.get('nodes')) + if event == 'execution_error': # Careful this might not be fully awaited. await update_run_with_output(prompt_id, data)