From 220db8a77db69c6153ac1de9ac8f014c911e6829 Mon Sep 17 00:00:00 2001 From: Michal Vitecek Date: Fri, 10 Jul 2009 11:27:31 +0200 Subject: [PATCH] Quick synchronizations (for 'quick' > 0) are now performed between full synchronizations (as specified in the documentation). Hello John, The attached patch makes quick synchronization work again (according to the documentation), so there are quick synchronizations performed between full synchronizations. Thanks, Michal --- offlineimap/accounts.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/offlineimap/accounts.py b/offlineimap/accounts.py index 55fba9b..f0f19e4 100644 --- a/offlineimap/accounts.py +++ b/offlineimap/accounts.py @@ -109,6 +109,7 @@ class Account(CustomConfig.ConfigHelperMixin): self.localeval = config.getlocaleval() self.ui = UIBase.getglobalui() self.refreshperiod = self.getconffloat('autorefresh', 0.0) + self.quickrefreshcount = self.getconfint('quick', 0) self.quicknum = 0 if self.refreshperiod == 0.0: self.refreshperiod = None @@ -144,8 +145,11 @@ class Account(CustomConfig.ConfigHelperMixin): for item in kaobjs: item.startkeepalive() - - refreshperiod = int(self.refreshperiod * 60) + + sleeptime = int(self.refreshperiod * 60) + if (self.quickrefreshcount > 0): + sleeptime = int(sleeptime / self.quickrefreshcount) + # try: # sleepresult = siglistener.get_nowait() # # retrieved signal before sleep started @@ -153,8 +157,8 @@ class Account(CustomConfig.ConfigHelperMixin): # # catching signal 1 here means folders were cleared before signal was posted # pass # except Empty: -# sleepresult = self.ui.sleep(refreshperiod, siglistener) - sleepresult = self.ui.sleep(refreshperiod, siglistener) +# sleepresult = self.ui.sleep(sleeptime, siglistener) + sleepresult = self.ui.sleep(sleeptime, siglistener) if sleepresult == 1: self.quicknum = 0