]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Fix `PeriodicCallback' when callback function return `Future' and has
authorWEI Zhicheng <zhicheng@opensourceforge.net>
Wed, 6 Aug 2014 10:35:24 +0000 (18:35 +0800)
committerBen Darnell <ben@bendarnell.com>
Sun, 10 Aug 2014 18:13:10 +0000 (14:13 -0400)
`Exception' will silence ignore

tornado/ioloop.py

index 738cc96440ecc60da71764c0e1801d0f23da8023..e15252d3450c779ca3b124db4da0a6840314b8ae 100644 (file)
@@ -969,10 +969,11 @@ class PeriodicCallback(object):
         if not self._running:
             return
         try:
-            self.callback()
+            return self.callback()
         except Exception:
             self.io_loop.handle_callback_exception(self.callback)
-        self._schedule_next()
+        finally:
+            self._schedule_next()
 
     def _schedule_next(self):
         if self._running: