Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <mpg@redhat.com>2007-09-18 18:18:11 (GMT)
committer Marco Pesenti Gritti <mpg@redhat.com>2007-09-18 18:18:11 (GMT)
commiteb8255a62755ab3cd16e2c5ba78cd196ab6b52f0 (patch)
treecc78fed5f2b9d9d525ff196f2a29021f8818cc32
parent830b1911db45a72fdbc611fb7a28c613c1278ea7 (diff)
Backport sync metadata delete from the versioning branch
-rw-r--r--src/olpc/datastore/xapianindex.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/olpc/datastore/xapianindex.py b/src/olpc/datastore/xapianindex.py
index 3568ea7..94e66f7 100644
--- a/src/olpc/datastore/xapianindex.py
+++ b/src/olpc/datastore/xapianindex.py
@@ -165,6 +165,13 @@ class IndexManager(object):
if not filestuff:
# In this case we are done
return
+ elif operation is DELETE:
+ # sync deletes
+ with self._write_lock:
+ self.write_index.delete(uid)
+ logger.info("deleted content %s:%s" % (uid,vid))
+ self.flush()
+ return
self.queue.put((uid, vid, doc, operation, filestuff))
@@ -190,10 +197,7 @@ class IndexManager(object):
try:
with self._write_lock:
- if operation is DELETE:
- self.write_index.delete(uid)
- logger.info("deleted content %s" % (uid,))
- elif operation is UPDATE:
+ if operation is UPDATE:
# Here we handle the conversion of binary
# documents to plain text for indexing. This is
# done in the thread to keep things async and