From a2372c5eaa6357dc678239ccea21c4e42f3f5aae Mon Sep 17 00:00:00 2001
From: ValueOn AG
Date: Fri, 17 Apr 2026 21:46:25 +0200
Subject: [PATCH] fixes
---
app.py | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/app.py b/app.py
index ae409883..cb9377af 100644
--- a/app.py
+++ b/app.py
@@ -360,6 +360,18 @@ async def lifespan(app: FastAPI):
eventManager.set_event_loop(main_loop)
from modules.workflows.scheduler.mainScheduler import setMainLoop as setSchedulerMainLoop
setSchedulerMainLoop(main_loop)
+
+ # Suppress noisy ConnectionResetError from ProactorEventLoop on Windows
+ # when clients (browsers) close connections abruptly. This is a known
+ # asyncio issue on Windows: https://bugs.python.org/issue39010
+ def _suppressClientDisconnect(loop, ctx):
+ exc = ctx.get("exception")
+ if isinstance(exc, ConnectionResetError):
+ return
+ if isinstance(exc, ConnectionAbortedError):
+ return
+ loop.default_exception_handler(ctx)
+ main_loop.set_exception_handler(_suppressClientDisconnect)
except RuntimeError:
pass
eventManager.start()