mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-25 01:56:34 +00:00
Use uvloop & aiohttp C extension (#279)
* Update Dockerfile * Update __main__.py * Update Dockerfile * Update Dockerfile * Update Dockerfile * Update Dockerfile * Update Dockerfile * Update Dockerfile * Update Dockerfile * Update Dockerfile * Update Dockerfile
This commit is contained in:
parent
c691f2a559
commit
7349234638
15
Dockerfile
15
Dockerfile
@ -6,9 +6,18 @@ ENV LANG C.UTF-8
|
|||||||
|
|
||||||
# Setup base
|
# Setup base
|
||||||
RUN apk add --no-cache \
|
RUN apk add --no-cache \
|
||||||
python3 \
|
python3 \
|
||||||
git \
|
git \
|
||||||
socat
|
socat \
|
||||||
|
libstdc++ \
|
||||||
|
&& apk add --no-cache --virtual .build-dependencies \
|
||||||
|
make \
|
||||||
|
python3-dev \
|
||||||
|
g++ \
|
||||||
|
&& pip3 install --no-cache-dir \
|
||||||
|
uvloop \
|
||||||
|
cchardet \
|
||||||
|
&& apk del .build-dependencies
|
||||||
|
|
||||||
# Install HassIO
|
# Install HassIO
|
||||||
COPY . /usr/src/hassio
|
COPY . /usr/src/hassio
|
||||||
|
@ -10,9 +10,19 @@ import hassio.core as core
|
|||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
def attempt_use_uvloop():
|
||||||
|
"""Attempt to use uvloop."""
|
||||||
|
try:
|
||||||
|
import uvloop
|
||||||
|
asyncio.set_event_loop_policy(uvloop.EventLoopPolicy())
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
# pylint: disable=invalid-name
|
# pylint: disable=invalid-name
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
bootstrap.initialize_logging()
|
bootstrap.initialize_logging()
|
||||||
|
attempt_use_uvloop()
|
||||||
loop = asyncio.get_event_loop()
|
loop = asyncio.get_event_loop()
|
||||||
|
|
||||||
if not bootstrap.check_environment():
|
if not bootstrap.check_environment():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user