[PATCH 3/6] Re: Change keepalive() to spawn IdleThreads

Nicolas Sebrecht nicolas.s-dev at laposte.net
Wed May 18 18:25:10 BST 2011


On Wed, May 18, 2011 at 08:48:54AM -0400, Ethan Glasser-Camp wrote:
> 
> This is the commit that enables IDLE support. In order to do this, we
> hijack the keepalive method. Instead of just sending NOOPs, it now
> sends IDLE and responds accordingly, thanks to the IdleThread class.
> 
> This code was originally by James Bunton <jamesbunton at fastmail.fm>.
> 
> Signed-off-by: Ethan Glasser-Camp <ethan at betacantrips.com>
> ---
>  offlineimap/imapserver.py |   30 +++++++++++++-----------------
>  1 files changed, 13 insertions(+), 17 deletions(-)
> 
> diff --git a/offlineimap/imapserver.py b/offlineimap/imapserver.py
> index ebd867e..ceea3dc 100644
> --- a/offlineimap/imapserver.py
> +++ b/offlineimap/imapserver.py
> @@ -330,8 +330,6 @@ class IMAPServer:
>          self.ui.debug('imap', 'keepalive thread started')
>          while 1:
>              self.ui.debug('imap', 'keepalive: top of loop')
> -            time.sleep(timeout)

So, the time import is not needed anymore.

-- 
Nicolas Sebrecht




More information about the OfflineIMAP-project mailing list