[Checkins] SVN: Sandbox/gotcha/z3c.taskqueue/trunk/ Avoid thread to stop if there is an error in processNext

Jean-Francois Roche jfroche at jfroche.be
Mon May 16 09:11:02 EDT 2011


Log message for revision 121672:
  Avoid thread to stop if there is an error in processNext

Changed:
  U   Sandbox/gotcha/z3c.taskqueue/trunk/docs/HISTORY.txt
  U   Sandbox/gotcha/z3c.taskqueue/trunk/src/z3c/taskqueue/processor.py

-=-
Modified: Sandbox/gotcha/z3c.taskqueue/trunk/docs/HISTORY.txt
===================================================================
--- Sandbox/gotcha/z3c.taskqueue/trunk/docs/HISTORY.txt	2011-05-16 12:59:57 UTC (rev 121671)
+++ Sandbox/gotcha/z3c.taskqueue/trunk/docs/HISTORY.txt	2011-05-16 13:11:02 UTC (rev 121672)
@@ -4,7 +4,7 @@
 0.1-alpha-4 (unreleased)
 ------------------------
 
-- Nothing changed yet.
+- Avoid thread to stop if there is an error in processNext
 
 
 0.1-alpha-3 (2010-11-19)

Modified: Sandbox/gotcha/z3c.taskqueue/trunk/src/z3c/taskqueue/processor.py
===================================================================
--- Sandbox/gotcha/z3c.taskqueue/trunk/src/z3c/taskqueue/processor.py	2011-05-16 12:59:57 UTC (rev 121671)
+++ Sandbox/gotcha/z3c.taskqueue/trunk/src/z3c/taskqueue/processor.py	2011-05-16 13:11:02 UTC (rev 121672)
@@ -88,7 +88,11 @@
 
     def __call__(self):
         while self.running:
-            result = self.processNext()
+            try:
+                result = self.processNext()
+            except Exception, error:
+                log.exception(error)
+                result = None
             # If there are no jobs available, sleep a little bit and then
             # check again.
             if not result:



More information about the checkins mailing list