Sleep for a while in loops - drastically reduces CPU load
This commit is contained in:
parent
188df24429
commit
fdc8f53131
2 changed files with 5 additions and 0 deletions
|
@ -87,9 +87,11 @@ class PlexCompanion(threading.Thread):
|
||||||
|
|
||||||
subscribers.subMgr.notify()
|
subscribers.subMgr.notify()
|
||||||
settings['serverList'] = self.client.getServerList()
|
settings['serverList'] = self.client.getServerList()
|
||||||
|
xbmc.sleep(50)
|
||||||
except:
|
except:
|
||||||
self.logMsg("Error in loop, continuing anyway", 1)
|
self.logMsg("Error in loop, continuing anyway", 1)
|
||||||
self.logMsg(traceback.print_exc(), 1)
|
self.logMsg(traceback.print_exc(), 1)
|
||||||
|
xbmc.sleep(50)
|
||||||
|
|
||||||
self.client.stop_all()
|
self.client.stop_all()
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -455,5 +455,8 @@ class UserClient(threading.Thread):
|
||||||
log("Server found: %s" % server, 2)
|
log("Server found: %s" % server, 2)
|
||||||
self.auth = True
|
self.auth = True
|
||||||
|
|
||||||
|
# Minimize CPU load
|
||||||
|
xbmc.sleep(500)
|
||||||
|
|
||||||
self.doUtils.stopSession()
|
self.doUtils.stopSession()
|
||||||
log("##===---- UserClient Stopped ----===##", 0)
|
log("##===---- UserClient Stopped ----===##", 0)
|
||||||
|
|
Loading…
Reference in a new issue