mirror of
https://github.com/home-assistant/core.git
synced 2025-07-31 19:25:12 +02:00
Turn on thread safety checks in async_dispatcher_send (#116867)
* Turn on thread safety checks in async_dispatcher_send We keep seeing issues where async_dispatcher_send is called from a thread which means we call the callback function on the other side in the thread as well which usually leads to a crash * Turn on thread safety checks in async_dispatcher_send We keep seeing issues where async_dispatcher_send is called from a thread which means we call the callback function on the other side in the thread as well which usually leads to a crash * adjust
This commit is contained in:
@@ -84,7 +84,7 @@ from .helpers import (
|
||||
template,
|
||||
translation,
|
||||
)
|
||||
from .helpers.dispatcher import async_dispatcher_send
|
||||
from .helpers.dispatcher import async_dispatcher_send_internal
|
||||
from .helpers.storage import get_internal_store_manager
|
||||
from .helpers.system_info import async_get_system_info
|
||||
from .helpers.typing import ConfigType
|
||||
@@ -700,7 +700,7 @@ class _WatchPendingSetups:
|
||||
def _async_dispatch(self, remaining_with_setup_started: dict[str, float]) -> None:
|
||||
"""Dispatch the signal."""
|
||||
if remaining_with_setup_started or not self._previous_was_empty:
|
||||
async_dispatcher_send(
|
||||
async_dispatcher_send_internal(
|
||||
self._hass, SIGNAL_BOOTSTRAP_INTEGRATIONS, remaining_with_setup_started
|
||||
)
|
||||
self._previous_was_empty = not remaining_with_setup_started
|
||||
|
Reference in New Issue
Block a user