From eb8255a62755ab3cd16e2c5ba78cd196ab6b52f0 Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Tue, 18 Sep 2007 18:18:11 +0000 Subject: Backport sync metadata delete from the versioning branch --- 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 -- cgit v0.9.1