From d473a211d07f5eb14e0c8a09d35c0386e71c66c7 Mon Sep 17 00:00:00 2001 From: bennykok Date: Wed, 7 Feb 2024 13:20:10 +0800 Subject: [PATCH] fix: running locally cause a crash in after adding live status --- custom_routes.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/custom_routes.py b/custom_routes.py index 759a41f..6169626 100644 --- a/custom_routes.py +++ b/custom_routes.py @@ -358,12 +358,14 @@ async def send_json_override(self, event, data, sid=None): if event == 'executing' and data.get('node') is not None: node = data.get('node') - if 'last_updated_node' in prompt_metadata[prompt_id] and prompt_metadata[prompt_id]['last_updated_node'] == node: - return - prompt_metadata[prompt_id]['last_updated_node'] = node - class_type = prompt_metadata[prompt_id]['workflow_api'][node]['class_type'] - print("updating run live status", class_type) - await update_run_live_status(prompt_id, "Executing " + class_type) + + if 'prompt_id' in prompt_metadata: + if 'last_updated_node' in prompt_metadata[prompt_id] and prompt_metadata[prompt_id]['last_updated_node'] == node: + return + prompt_metadata[prompt_id]['last_updated_node'] = node + class_type = prompt_metadata[prompt_id]['workflow_api'][node]['class_type'] + print("updating run live status", class_type) + await update_run_live_status(prompt_id, "Executing " + class_type) if event == 'execution_error': # Careful this might not be fully awaited.