From a78184f90c21e3b2d288891e243c111f8091c3d4 Mon Sep 17 00:00:00 2001 From: WEI Zhicheng Date: Wed, 6 Aug 2014 18:35:24 +0800 Subject: [PATCH] Fix `PeriodicCallback' when callback function return `Future' and has `Exception' will silence ignore --- tornado/ioloop.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tornado/ioloop.py b/tornado/ioloop.py index 738cc964..e15252d3 100644 --- a/tornado/ioloop.py +++ b/tornado/ioloop.py @@ -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: