Avoid creating logbook stream task if unsubscribed while waiting for executor (#86363)
parent
8227c84e05
commit
c842666bea
|
@ -392,6 +392,10 @@ async def ws_event_stream(
|
|||
force_send=True,
|
||||
)
|
||||
|
||||
if msg_id not in connection.subscriptions:
|
||||
# Unsubscribe happened while sending historical events
|
||||
return
|
||||
|
||||
live_stream.task = asyncio.create_task(
|
||||
_async_events_consumer(
|
||||
subscriptions_setup_complete_time,
|
||||
|
@ -402,10 +406,6 @@ async def ws_event_stream(
|
|||
)
|
||||
)
|
||||
|
||||
if msg_id not in connection.subscriptions:
|
||||
# Unsubscribe happened while sending historical events
|
||||
return
|
||||
|
||||
live_stream.wait_sync_task = asyncio.create_task(
|
||||
get_instance(hass).async_block_till_done()
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue