Merge pull request #148 from teto/simple_fix_notmuch
Simple fix for notmuch database not in sync
This commit is contained in:
commit
b0b4d939ec
@ -43,6 +43,10 @@ class Mail(IntervalModule):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
|
"""
|
||||||
|
Returns the sum of unread messages across all registered backends
|
||||||
|
"""
|
||||||
|
|
||||||
unread = sum(map(lambda backend: backend.unread, self.backends))
|
unread = sum(map(lambda backend: backend.unread, self.backends))
|
||||||
|
|
||||||
if not unread:
|
if not unread:
|
||||||
|
@ -35,11 +35,12 @@ class Notmuch(Backend):
|
|||||||
|
|
||||||
self.db_path = config.get("database", "path")
|
self.db_path = config.get("database", "path")
|
||||||
|
|
||||||
self.db = notmuch.Database(self.db_path)
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def unread(self):
|
def unread(self):
|
||||||
return notmuch.Query(self.db, "tag:unread and tag:inbox").count_messages()
|
db = notmuch.Database(self.db_path)
|
||||||
|
result = notmuch.Query(db, "tag:unread and tag:inbox").count_messages()
|
||||||
|
db.close()
|
||||||
|
return result
|
||||||
|
|
||||||
|
|
||||||
Backend = Notmuch
|
Backend = Notmuch
|
||||||
|
Loading…
Reference in New Issue
Block a user