Rework keepalive to use time.sleep() instead of event.wait()
This should improve power-management abilities some more The catch is that we can't wait any longer for the kathread to terminate. We were waiting for this in some cases. This is probably not a big deal. fixes deb#434074 fixes #66
This commit is contained in:
@ -83,16 +83,10 @@ class Account(CustomConfig.ConfigHelperMixin):
|
||||
|
||||
refreshperiod = int(self.refreshperiod * 60)
|
||||
sleepresult = self.ui.sleep(refreshperiod)
|
||||
if sleepresult == 2:
|
||||
# Cancel keep-alive, but don't bother terminating threads
|
||||
for item in kaobjs:
|
||||
item.stopkeepalive(abrupt = 1)
|
||||
return sleepresult
|
||||
else:
|
||||
# Cancel keep-alive and wait for thread to terminate.
|
||||
for item in kaobjs:
|
||||
item.stopkeepalive(abrupt = 0)
|
||||
return sleepresult
|
||||
# Cancel keepalive
|
||||
for item in kaobjs:
|
||||
item.stopkeepalive()
|
||||
return sleepresult
|
||||
|
||||
class AccountSynchronizationMixin:
|
||||
def syncrunner(self):
|
||||
|
Reference in New Issue
Block a user