From 478ab42de84d4f870f46ba2c977e6916c85d2518 Mon Sep 17 00:00:00 2001 From: bymyself Date: Tue, 13 May 2025 22:15:38 -0700 Subject: [PATCH] don't retry if API returns task failure --- comfy_api_nodes/apis/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/comfy_api_nodes/apis/client.py b/comfy_api_nodes/apis/client.py index 838ff1e8d..62866216f 100644 --- a/comfy_api_nodes/apis/client.py +++ b/comfy_api_nodes/apis/client.py @@ -1105,7 +1105,7 @@ class PollingOperation(Generic[T, R]): except Exception as e: # For other errors, increment count and potentially abort consecutive_errors += 1 - if consecutive_errors >= max_consecutive_errors: + if consecutive_errors >= max_consecutive_errors or status == TaskStatus.FAILED: raise Exception( f"Polling aborted after {consecutive_errors} consecutive errors: {str(e)}" ) from e