Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce latency to set up websocket forwarding in hassio #111558

Merged
merged 1 commit into from Feb 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions homeassistant/components/hassio/ingress.py
Expand Up @@ -18,6 +18,7 @@
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from homeassistant.helpers.typing import UNDEFINED
from homeassistant.util.async_ import create_eager_task

from .const import X_HASS_SOURCE, X_INGRESS_PATH
from .http import should_compress
Expand Down Expand Up @@ -143,8 +144,8 @@ async def _handle_websocket(
# Proxy requests
await asyncio.wait(
[
asyncio.create_task(_websocket_forward(ws_server, ws_client)),
asyncio.create_task(_websocket_forward(ws_client, ws_server)),
create_eager_task(_websocket_forward(ws_server, ws_client)),
create_eager_task(_websocket_forward(ws_client, ws_server)),
],
return_when=asyncio.FIRST_COMPLETED,
)
Expand Down