Use uvloop for asyncio policy (#3417)
This commit is contained in:
parent
43c395232a
commit
54248863b3
2 changed files with 7 additions and 1 deletions
|
@ -21,7 +21,7 @@ RUN script/build_python_openzwave && \
|
||||||
COPY requirements_all.txt requirements_all.txt
|
COPY requirements_all.txt requirements_all.txt
|
||||||
# certifi breaks Debian based installs
|
# certifi breaks Debian based installs
|
||||||
RUN pip3 install --no-cache-dir -r requirements_all.txt && pip3 uninstall -y certifi && \
|
RUN pip3 install --no-cache-dir -r requirements_all.txt && pip3 uninstall -y certifi && \
|
||||||
pip3 install mysqlclient psycopg2
|
pip3 install mysqlclient psycopg2 uvloop
|
||||||
|
|
||||||
# Copy source
|
# Copy source
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
|
@ -40,6 +40,12 @@ import homeassistant.util.dt as dt_util
|
||||||
import homeassistant.util.location as location
|
import homeassistant.util.location as location
|
||||||
from homeassistant.util.unit_system import UnitSystem, METRIC_SYSTEM # NOQA
|
from homeassistant.util.unit_system import UnitSystem, METRIC_SYSTEM # NOQA
|
||||||
|
|
||||||
|
try:
|
||||||
|
import uvloop
|
||||||
|
asyncio.set_event_loop_policy(uvloop.EventLoopPolicy())
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
|
|
||||||
DOMAIN = "homeassistant"
|
DOMAIN = "homeassistant"
|
||||||
|
|
||||||
# How often time_changed event should fire
|
# How often time_changed event should fire
|
||||||
|
|
Loading…
Add table
Reference in a new issue