mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-31 15:12:06 +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): | class SerialPortRequestHandler(BaseHandler): | ||||||
|     @authenticated |     @authenticated | ||||||
|     def get(self): |     async def get(self): | ||||||
|         ports = get_serial_ports() |         ports = await tornado.ioloop.IOLoop.run_in_executor(None, get_serial_ports) | ||||||
|         data = [] |         data = [] | ||||||
|         for port in ports: |         for port in ports: | ||||||
|             desc = port.description |             desc = port.description | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user