fix how we count how many items we did this loop twisty
authorMark Hammond <mhammond@skippinet.com.au>
Mon, 30 Mar 2009 11:32:53 +1100
branchtwisty
changeset 141 9aa5903c2e4eb77802b9f2a3b72679f04e5dcdc6
parent 140 5ef43d01c4fec2325a44db4c56cda04a2c44a7f8
child 142 904171c40909c7f8840bedd98e6154f4babee78d
push id1
push userroot
push dateWed, 08 Apr 2009 01:46:05 +0000
fix how we count how many items we did this loop
server/python/junius/pipeline.py
--- a/server/python/junius/pipeline.py
+++ b/server/python/junius/pipeline.py
@@ -53,24 +53,24 @@ class Pipeline(object):
                 self.forward_chain[from_type] = None
 
     def start(self):
         return self.coop.coiterate(self.gen_all_documents())
 
     def gen_all_documents(self):
         # check *every* doc in the DB.  This exists until we can derive
         # a workqueue based on views.
-        self.num_this_process = 0
         while True:
+            self.num_this_process = 0
             logger.debug('opening view for work queue...')
             yield self.doc_model.db.openView('raindrop!messages!workqueue',
                                              'by_doc_roots',
                                              group=True,
                         ).addCallback(self._cb_roots_opened)
-            logger.info('processed %d documents', self.num_this_process)
+            logger.info('created %d new documents', self.num_this_process)
             if self.num_this_process == 0:
                 break
         logger.debug('finally run out of documents.')
 
     def _cb_roots_opened(self, rows):
         logger.info('work queue has %d items to check.', len(rows))
         def gen_todo(todo):
             for row in todo: