docker-offlineimap/offlineimap
Sebastian Spaeth 1b54b85f20 Reuse LocalStatus() folders rather than recreate instances
If we ask twice for a LocalStatusFolder via getfolder(), we would
get a newly created instance each time. This can lead to problems,
as e.g. write locks protecting files only work within the same Folder
instance. Make it so, that we cache all Folder instances that we have
asked for and hand back the existing one if we ask again for it,
rather than recreate a new instance.

Also, make getfolders() a noop for LocalStatus. We attempted to
derive the foldername from the name of the LocalStatusfile. However,
this is not really possible, as we do file name mangling
(".$" -> "dot", "/" -> ".") and there is no way to get the original folder
name from the LocalStatus file name anyway.

This commit could potentially solve the "file not found" errors, that people
have been seeing with their LocalStatusCache files. If we have 2
instances of a LocalStatusFolder pointing to the same file, our locking
system would not work.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-09-01 01:19:19 +02:00
..
folder Use "with lock" pattern 2012-08-31 22:34:53 +02:00
repository Reuse LocalStatus() folders rather than recreate instances 2012-09-01 01:19:19 +02:00
ui Don't output initial blurb in "quiet" mode 2012-08-31 23:11:11 +02:00
__init__.py Release v6.5.4 2012-06-02 13:41:20 +02:00
accounts.py Reuse LocalStatus() folders rather than recreate instances 2012-09-01 01:19:19 +02:00
CustomConfig.py Implement CustomConfig.set_if_not_exists() 2012-02-17 10:28:59 +01:00
error.py Introduce new error level FOLDER_RETRY 2011-09-06 19:00:21 +02:00
imaplib2.py imaplib2: bump upstream version 2.29 --> 2.33 2012-04-19 13:22:03 +02:00
imaplibutil.py IMAPlib mixin class: pass 'readonly' exception to our callers 2012-08-11 11:59:26 +02:00
imapserver.py Replace thread.get_ident() 2012-02-06 17:41:43 +01:00
imaputil.py Improve 'find first quotation' regex 2012-08-21 16:58:32 +02:00
init.py -f command line option only works on the untranslated remote names 2012-02-24 14:52:30 +01:00
localeval.py Update FSF address 2006-08-12 05:15:55 +01:00
mbnames.py explicitly define symbols to import instead of 'import *' 2011-05-09 22:43:03 +02:00
syncmaster.py Exit "infinite" monitorloop when SyncRunner thread exits 2011-11-02 11:55:05 +01:00
threadutil.py dict.has_key(a) --> a in dict 2012-02-06 17:41:43 +01:00