diff options
| author | 2012-12-07 01:16:36 +0100 | |
|---|---|---|
| committer | 2012-12-07 01:16:36 +0100 | |
| commit | 044c6114aa8ecee59e206f0de085559255ee55ff (patch) | |
| tree | 5ab22159170c6b1ddb303b94f7fc05d6c665b73e /gmail-notmuch.py | |
| parent | Improve strings. (diff) | |
| download | gmail-notmuch-044c6114aa8ecee59e206f0de085559255ee55ff.tar.xz gmail-notmuch-044c6114aa8ecee59e206f0de085559255ee55ff.zip | |
Make all database operations atomic.
Diffstat (limited to 'gmail-notmuch.py')
| -rwxr-xr-x | gmail-notmuch.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/gmail-notmuch.py b/gmail-notmuch.py index 7eaf9e2..8704edd 100755 --- a/gmail-notmuch.py +++ b/gmail-notmuch.py @@ -117,11 +117,13 @@ def download_new_messages(imap, messages, destination): os.link(temp, dest) # Because DJB says so... os.unlink(temp) + database.begin_atomic() message = database.add_message(dest, True)[0] message.freeze() for tag in labels: message.add_tag(tag, True) message.thaw() + database.end_atomic() progressbar.update(i) i += 1 |
