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()
|
||||
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:
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue