From 9a56bb6fb0a9d7075ca4a08b3cddd7df7fa7344e Mon Sep 17 00:00:00 2001 From: Henry Cheung Date: Thu, 27 Dec 2018 10:09:54 +0800 Subject: [PATCH] fix high cpu utilzation when autoaddmgr is running on JsonServer --- libs/SmartMeshSDK/utils/SerialScanner.py | 1 + 1 file changed, 1 insertion(+) diff --git a/libs/SmartMeshSDK/utils/SerialScanner.py b/libs/SmartMeshSDK/utils/SerialScanner.py index 9523f2c..968552f 100644 --- a/libs/SmartMeshSDK/utils/SerialScanner.py +++ b/libs/SmartMeshSDK/utils/SerialScanner.py @@ -165,6 +165,7 @@ def run(self): self.goOn = False serialHandler.close() while listenThread.isAlive(): + time.sleep(0.01) pass # wait for listenThread to stop except serial.SerialException: pass # happens when serial port unavailable