Skip to content

Commit

Permalink
fix: retry api only when request failed to comfyui api
Browse files Browse the repository at this point in the history
  • Loading branch information
Calvin-Huang committed Dec 23, 2024
1 parent a836879 commit 188b994
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/rp_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def queue_workflow(workflow):
try:
req = urllib.request.Request(f"http://{COMFY_HOST}/prompt", data=data)
return json.loads(urllib.request.urlopen(req).read())
except Exception as e:
except requests.RequestException as e:
print(f"Error queuing workflow: {str(e)}. Retrying...")
time.sleep(COMFY_API_AVAILABLE_INTERVAL_MS / 1000)
retries += 1
Expand Down

0 comments on commit 188b994

Please sign in to comment.