Compare commits

...

7 Commits

Author SHA1 Message Date
Li Xiang
8e28489a69
Merge 68f852aff5 into 38d0493825 2026-01-04 18:15:22 -06:00
Li Xiang
68f852aff5
Merge branch 'master' into master 2025-12-30 16:58:28 +08:00
Li Xiang
755fab5498
Merge branch 'master' into master 2025-12-29 21:52:41 +08:00
Li Xiang
eebc76ebc4
Merge branch 'master' into master 2025-12-27 10:59:59 +08:00
Li Xiang
2fc6ddd270
Update main.py 2025-12-26 22:15:49 +08:00
Li Xiang
e8d6b9a593
Rename prompt_worker_crashfast to prompt_worker_failfast 2025-12-26 22:12:14 +08:00
Li Xiang
6c08073d31
Handle prompt_worker crashes with a critical log 2025-12-26 14:09:30 +08:00

10
main.py
View File

@ -328,6 +328,14 @@ def setup_database():
logging.error(f"Failed to initialize database. Please ensure you have installed the latest requirements. If the error persists, please report this as in future the database will be required: {e}")
def prompt_worker_failfast(*args, **kwargs):
try:
return prompt_worker(*args, **kwargs)
except Exception:
logging.critical("Unhandled exception in prompt_worker; exiting process.", exc_info=True)
os._exit(1)
def start_comfyui(asyncio_loop=None):
"""
Starts the ComfyUI server using the provided asyncio event loop or creates a new one.
@ -367,7 +375,7 @@ def start_comfyui(asyncio_loop=None):
prompt_server.add_routes()
hijack_progress(prompt_server)
threading.Thread(target=prompt_worker, daemon=True, args=(prompt_server.prompt_queue, prompt_server,)).start()
threading.Thread(target=prompt_worker_failfast, daemon=True, args=(prompt_server.prompt_queue, prompt_server,)).start()
if args.quick_test_for_ci:
exit(0)