From 6fcda106a5f6a0ca5945283e2ebc1f54925a63cf Mon Sep 17 00:00:00 2001 From: Duda Dornelles Date: Wed, 22 Oct 2014 15:58:15 +0200 Subject: index mails to accept a callback so that we can mark all as not recent when we are done indexing mails --- service/pixelated/adapter/search.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/service/pixelated/adapter/search.py b/service/pixelated/adapter/search.py index 71b72dba..a5897a12 100644 --- a/service/pixelated/adapter/search.py +++ b/service/pixelated/adapter/search.py @@ -129,10 +129,12 @@ class SearchEngine(object): writer.update_document(**index_data) - def index_mails(self, mails): + def index_mails(self, mails, callback=None): with self._index.writer() as writer: for mail in mails: self._index_mail(writer, mail) + if callback: + callback() def _search_with_options(self, options, query): with self._index.searcher() as searcher: -- cgit v1.2.3