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)
threadutil.threadsreset(folderthreads)
mbnames.write()
localrepos.forgetfolders()
remoterepos.forgetfolders()
localrepos.holdordropconnections()
remoterepos.holdordropconnections()
finally:

View File

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

View File

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