mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-31 07:03:55 +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:
		| @@ -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 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user