summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Totzke <patricktotzke@gmail.com>2012-02-26 17:26:52 +0000
committerPatrick Totzke <patricktotzke@gmail.com>2012-02-26 17:26:52 +0000
commit66369dadea1fccfc8cda844b023296845ad15fe5 (patch)
tree498d1d70842bd5b10125af4ac647336e8f2d6ed2
parentbcea1912abaf135d653425641ed778a62921a612 (diff)
Revert "wip:flush"
This reverts commit 39f74fdd0f4a4e6f4a12765217fdf9b56fb5c189. ..which was accidentally pushed to testing
-rw-r--r--alot/db.py15
1 files changed, 6 insertions, 9 deletions
diff --git a/alot/db.py b/alot/db.py
index e6f2c649..44ca608d 100644
--- a/alot/db.py
+++ b/alot/db.py
@@ -86,6 +86,12 @@ class DBManager(object):
if self.ro:
raise DatabaseROError()
if self.writequeue:
+ # aquire a writeable db handler
+ try:
+ mode = Database.MODE.READ_WRITE
+ db = Database(path=self.path, mode=mode)
+ except NotmuchError:
+ raise DatabaseLockedError()
# read notmuch's config regarding imap flag synchronization
sync = settings.get_notmuch_setting('maildir', 'synchronize_flags')
@@ -98,13 +104,6 @@ class DBManager(object):
# watch out for notmuch errors to re-insert current_item
# to the queue on errors
try:
- # aquire a writeable db handler
- try:
- mode = Database.MODE.READ_WRITE
- db = Database(path=self.path, mode=mode)
- except NotmuchError:
- raise DatabaseLockedError()
-
# the first two coordinants are cnmdname and post-callback
cmd, afterwards = current_item[:2]
@@ -149,8 +148,6 @@ class DBManager(object):
if db.end_atomic() != notmuch.STATUS.SUCCESS:
raise DatabaseError('fail-status from end_atomic')
- # close db
- db.close()
# call post-callback
if callable(afterwards):
afterwards()