Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src/carquinyol/indexstore.py
diff options
context:
space:
mode:
authorSascha Silbe <sascha-pgp@silbe.org>2010-03-08 12:42:37 (GMT)
committer Sascha Silbe <sascha-pgp@silbe.org>2010-03-08 12:42:37 (GMT)
commit64fe91e95435fc314594939c74cdbf57e43a5050 (patch)
tree577a8c39cc4225299063884b0ce1017b890a50d4 /src/carquinyol/indexstore.py
parent658c38552a359640c317018e98174ace6866ea16 (diff)
rebuild index on migration (#1787)
Currently we force an index rescan on migration, but not a rebuild. Any entry that's already in the index will _not_ be updated. This patch fixes the migration logic to do a full index rebuild, thus actually migrating the index. Signed-off-by: Sascha Silbe <sascha-pgp@silbe.org>
Diffstat (limited to 'src/carquinyol/indexstore.py')
-rw-r--r--src/carquinyol/indexstore.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/carquinyol/indexstore.py b/src/carquinyol/indexstore.py
index 4dfd620..8a69334 100644
--- a/src/carquinyol/indexstore.py
+++ b/src/carquinyol/indexstore.py
@@ -220,6 +220,10 @@ class IndexStore(object):
self._database = WritableDatabase(index_path, xapian.DB_CREATE_OR_OPEN)
def close_index(self):
+ """Close index database if it is open."""
+ if not self._database:
+ return
+
self._database.flush()
self._database = None