docker-offlineimap/offlineimap/repository
Nicolas Sebrecht 038a433f69 backport: sqlite: properly serialize operations on the databases
1. There is one database per folder and sqlite requires to serialize the
writings. Instead of locking at LocalStatusSQLiteFolder object level, introduce
a new DatabaseFileLock object which is shared across threads. This fixes the
concurrent writes issues that some users might experience by duplications or
flags restored to the previous state.

2. Close the database only when we are sure no other threads will use the
connection on a *per-file* basis. Previous fix 677afb8d8f is wrong
because the same lock is shared for all the databases.

Github-fix: https://github.com/OfflineIMAP/offlineimap/issues/350
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-07-26 02:00:17 +02:00
..
__init__.py more style consistency 2015-02-10 17:25:00 +01:00
Base.py SQLite: close db when done 2016-06-08 01:59:14 +02:00
Gmail.py do use the XOAUTH2 url if configured 2015-10-12 07:51:05 +02:00
GmailMaildir.py repository: GmailMaildir: fix copyright 2015-01-14 18:01:05 +01:00
IMAP.py change hard coding of AF_UNSPEC to user-defined address-families per repository 2016-02-23 06:57:21 +01:00
LocalStatus.py backport: sqlite: properly serialize operations on the databases 2016-07-26 02:00:17 +02:00
Maildir.py Keywords: avoid warning at each message when no keywords are used 2015-11-22 20:05:34 +01:00