don't delete messages in local cache in dry-run mode
This makes dry-run consitent when called more than once. Github-ref: https://github.com/OfflineIMAP/offlineimap/issues/370 Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
@ -24,6 +24,7 @@ import six
|
||||
|
||||
from .Base import BaseFolder
|
||||
|
||||
|
||||
class DatabaseFileLock(object):
|
||||
"""Lock at database file level."""
|
||||
|
||||
@ -125,7 +126,7 @@ class LocalStatusSQLiteFolder(BaseFolder):
|
||||
self.__upgrade_db(version)
|
||||
|
||||
def purge(self):
|
||||
"""Remove any pre-existing database."""
|
||||
"""Remove any pre-existing database. Do not call in dry-run mode."""
|
||||
|
||||
try:
|
||||
os.unlink(self.filename)
|
||||
@ -328,7 +329,7 @@ class LocalStatusSQLiteFolder(BaseFolder):
|
||||
# We cannot assign a uid.
|
||||
return uid
|
||||
|
||||
if self.uidexists(uid): # already have it
|
||||
if self.uidexists(uid): # Already have it.
|
||||
self.savemessageflags(uid, flags)
|
||||
return uid
|
||||
|
||||
|
Reference in New Issue
Block a user