Sleep for a while in loops - drastically reduces CPU load

This commit is contained in:
tomkat83 2016-03-08 08:43:12 +01:00
parent 188df24429
commit fdc8f53131
2 changed files with 5 additions and 0 deletions

View file

@ -87,9 +87,11 @@ class PlexCompanion(threading.Thread):
subscribers.subMgr.notify()
settings['serverList'] = self.client.getServerList()
xbmc.sleep(50)
except:
self.logMsg("Error in loop, continuing anyway", 1)
self.logMsg(traceback.print_exc(), 1)
xbmc.sleep(50)
self.client.stop_all()
try:

View file

@ -455,5 +455,8 @@ class UserClient(threading.Thread):
log("Server found: %s" % server, 2)
self.auth = True
# Minimize CPU load
xbmc.sleep(500)
self.doUtils.stopSession()
log("##===---- UserClient Stopped ----===##", 0)