zachowj / hass-node-red

Companion Component for node-red-contrib-home-assistant-websocket to help integrate Node-RED with Home Assistant Core
MIT License
465 stars 182 forks source link

I/O in event loop #14

Closed balloob closed 4 years ago

balloob commented 4 years ago

Version of the custom_component

Current master branch.

Configuration


Add your logs here.

Describe the bug

I was interested in what this integration did. README wasn't very descriptive so browsing through the code and it's doing I/O inside the event loop. This should be done inside the executor worker thread.

https://github.com/zachowj/hass-node-red/blob/256bdda0b7448c3f499804366aea570a8607a31b/custom_components/nodered/__init__.py#L97

Change async def -> def and then run `result = await hass.async_add_executor_job(check_files)

Debug log


Add your logs here.
zachowj commented 4 years ago

Thank you.