mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-19 07:06:30 +00:00
No executor task in sentry call when not initialized (#5703)
This commit is contained in:
parent
d42ec12ae8
commit
5b18fb6b12
@ -62,9 +62,10 @@ async def async_capture_event(event: dict[str, Any], only_once: str | None = Non
|
|||||||
|
|
||||||
Safe to call from event loop.
|
Safe to call from event loop.
|
||||||
"""
|
"""
|
||||||
await asyncio.get_running_loop().run_in_executor(
|
if sentry_sdk.is_initialized():
|
||||||
None, capture_event, event, only_once
|
await asyncio.get_running_loop().run_in_executor(
|
||||||
)
|
None, capture_event, event, only_once
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def capture_exception(err: Exception) -> None:
|
def capture_exception(err: Exception) -> None:
|
||||||
@ -81,7 +82,10 @@ async def async_capture_exception(err: Exception) -> None:
|
|||||||
|
|
||||||
Safe to call in event loop.
|
Safe to call in event loop.
|
||||||
"""
|
"""
|
||||||
await asyncio.get_running_loop().run_in_executor(None, capture_exception, err)
|
if sentry_sdk.is_initialized():
|
||||||
|
await asyncio.get_running_loop().run_in_executor(
|
||||||
|
None, sentry_sdk.capture_exception, err
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def close_sentry() -> None:
|
def close_sentry() -> None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user