From 687fefb343ea597df420ea44998474da66911720 Mon Sep 17 00:00:00 2001 From: padioca <6464347+padioca@users.noreply.github.com> Date: Sat, 14 Mar 2026 15:31:33 -0500 Subject: [PATCH] =?UTF-8?q?fix:=20run=20Frigate+=20API=20calls=20in=20thre?= =?UTF-8?q?ad=20pool=20to=20prevent=20event=20loop=20bloc=E2=80=A6=20(#224?= =?UTF-8?q?26)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frigate/api/event.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/frigate/api/event.py b/frigate/api/event.py index b0a749018..567fe5a4b 100644 --- a/frigate/api/event.py +++ b/frigate/api/event.py @@ -1,5 +1,6 @@ """Event apis.""" +import asyncio import base64 import datetime import json @@ -1124,7 +1125,9 @@ async def send_to_plus(request: Request, event_id: str, body: SubmitPlusBody = N ) try: - plus_id = request.app.frigate_config.plus_api.upload_image(image, event.camera) + plus_id = await asyncio.to_thread( + request.app.frigate_config.plus_api.upload_image, image, event.camera + ) except Exception as ex: logger.exception(ex) return JSONResponse( @@ -1140,7 +1143,8 @@ async def send_to_plus(request: Request, event_id: str, body: SubmitPlusBody = N box = event.data["box"] try: - request.app.frigate_config.plus_api.add_annotation( + await asyncio.to_thread( + request.app.frigate_config.plus_api.add_annotation, event.plus_id, box, event.label, @@ -1230,7 +1234,8 @@ async def false_positive(request: Request, event_id: str): ) try: - request.app.frigate_config.plus_api.add_false_positive( + await asyncio.to_thread( + request.app.frigate_config.plus_api.add_false_positive, event.plus_id, region, box,