From c76725bb38fbe2b7e1d9c8cf8afcedf83a306e56 Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Mon, 5 May 2025 22:23:35 -0500 Subject: [PATCH] try using existing event loop instead of creating a new one --- frigate/ptz/onvif.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frigate/ptz/onvif.py b/frigate/ptz/onvif.py index 9e676fce3..f8c710c97 100644 --- a/frigate/ptz/onvif.py +++ b/frigate/ptz/onvif.py @@ -48,7 +48,7 @@ class OnvifController: self.ptz_metrics = ptz_metrics # Create a dedicated event loop and run it in a separate thread - self.loop = asyncio.new_event_loop() + self.loop = asyncio.get_event_loop() self.loop_thread = threading.Thread(target=self._run_event_loop, daemon=True) self.loop_thread.start() @@ -63,7 +63,7 @@ class OnvifController: def _run_event_loop(self) -> None: """Run the event loop in a separate thread.""" - asyncio.set_event_loop(self.loop) + # asyncio.set_event_loop(self.loop) try: self.loop.run_forever() except Exception as e: