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:
Pascal Vizeli 2017-12-12 23:38:33 +01:00 committed by GitHub
parent c691f2a559
commit 7349234638
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 3 deletions

View File

@ -6,9 +6,18 @@ ENV LANG C.UTF-8
# Setup base
RUN apk add --no-cache \
python3 \
git \
socat
python3 \
git \
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
COPY . /usr/src/hassio

View File

@ -10,9 +10,19 @@ import hassio.core as core
_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
if __name__ == "__main__":
bootstrap.initialize_logging()
attempt_use_uvloop()
loop = asyncio.get_event_loop()
if not bootstrap.check_environment():