aboutsummaryrefslogtreecommitdiffstats
path: root/worker/notmuch/lib/database.go
diff options
context:
space:
mode:
Diffstat (limited to 'worker/notmuch/lib/database.go')
-rw-r--r--worker/notmuch/lib/database.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/worker/notmuch/lib/database.go b/worker/notmuch/lib/database.go
index 501f39de..3b9de011 100644
--- a/worker/notmuch/lib/database.go
+++ b/worker/notmuch/lib/database.go
@@ -52,6 +52,13 @@ func (db *DB) ListTags() []string {
return db.db.Tags()
}
+// State returns the lastmod of the database. This is a uin64 which is
+// incremented with every modification
+func (db *DB) State() uint64 {
+ _, lastmod := db.db.Revision()
+ return lastmod
+}
+
// getQuery returns a query based on the provided query string.
// It also configures the query as specified on the worker
func (db *DB) newQuery(query string) (*notmuch.Query, error) {