Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/debian/patches/1004_avoid_queue_hints.patch
blob: a74d6487375356c748e82a7dd8a95fb879a9f11d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
diff --git a/src/olpc/datastore/xapianindex.py b/src/olpc/datastore/xapianindex.py
index b3da0cc..8cf6a5a 100644
--- a/src/olpc/datastore/xapianindex.py
+++ b/src/olpc/datastore/xapianindex.py
@@ -151,8 +151,7 @@ class IndexManager(object):
         
     def stopIndexer(self, force=False):
         if not self.indexer_running: return 
-        if not force: self.queue.join()
-        self.indexer_running = False
+        if force: self.indexer_running = False
         # should terminate after the current task
         self.indexer.join()
 
@@ -250,6 +249,7 @@ class IndexManager(object):
                 uid, vid, doc, operation, filestuff = data
             except Empty:
                 #time.sleep(1.0)
+                self.indexer_running = False
                 continue
 
             try:
@@ -281,9 +281,6 @@ class IndexManager(object):
                             logger.warning("""Conversion process failed for document %s %s""" % (uid, filename))
                     else:
                         logger.warning("Unknown indexer operation ( %s: %s)" % (uid, operation))
-
-                    # tell the queue its complete 
-                    self.queue.task_done()
                 finally:
                     self._write_lock.release()
 
@@ -297,7 +294,7 @@ class IndexManager(object):
         """Intentionally block until the indexing is complete. Used
         primarily in testing.
         """
-        self.queue.join()
+        self.indexer.join()
         self.flush()
     
     #