mirror of
https://github.com/esphome/esphome.git
synced 2025-02-12 16:08:19 +00:00
dashboard: Run get_serial_ports in the executor
get_serial_ports does blocking I/O and should not be running in tornado event loop
This commit is contained in:
parent
53f3385c49
commit
cad53556a5
@ -509,8 +509,8 @@ class EsphomeUpdateAllHandler(EsphomeCommandWebSocket):
|
||||
|
||||
class SerialPortRequestHandler(BaseHandler):
|
||||
@authenticated
|
||||
def get(self):
|
||||
ports = get_serial_ports()
|
||||
async def get(self):
|
||||
ports = await tornado.ioloop.IOLoop.run_in_executor(None, get_serial_ports)
|
||||
data = []
|
||||
for port in ports:
|
||||
desc = port.description
|
||||
|
Loading…
x
Reference in New Issue
Block a user