Re-scan list of remote folders on each sync

rather than just up-front.

fixes deb#396772
This commit is contained in:
John Goerzen 2007-07-06 17:46:29 +01:00
parent f0d48365cf
commit a381ca3977
3 changed files with 10 additions and 0 deletions

View File

@ -146,6 +146,8 @@ class AccountSynchronizationMixin:
folderthreads.append(thread) folderthreads.append(thread)
threadutil.threadsreset(folderthreads) threadutil.threadsreset(folderthreads)
mbnames.write() mbnames.write()
localrepos.forgetfolders()
remoterepos.forgetfolders()
localrepos.holdordropconnections() localrepos.holdordropconnections()
remoterepos.holdordropconnections() remoterepos.holdordropconnections()
finally: finally:

View File

@ -106,6 +106,11 @@ class BaseRepository(CustomConfig.ConfigHelperMixin):
"""Returns a list of ALL folders on this server.""" """Returns a list of ALL folders on this server."""
return [] return []
def forgetfolders(self):
"""Forgets the cached list of folders, if any. Useful to run
after a sync run."""
pass
def getsep(self): def getsep(self):
raise NotImplementedError raise NotImplementedError

View File

@ -160,6 +160,9 @@ class IMAPRepository(BaseRepository):
imapobj = self.imapserver.acquireconnection() imapobj = self.imapserver.acquireconnection()
self.imapserver.releaseconnection(imapobj) self.imapserver.releaseconnection(imapobj)
def forgetfolders(self):
self.folders = None
def getfolders(self): def getfolders(self):
if self.folders != None: if self.folders != None:
return self.folders return self.folders