If a PeriodicCallback runs longer than its period, skip the missed callbacks
instead of trying to run all the missed callbacks to catch up.
This commit is contained in:
parent
01be222ec8
commit
7aec8fc9b3
|
@ -461,6 +461,8 @@ class PeriodicCallback(object):
|
||||||
|
|
||||||
def _schedule_next(self):
|
def _schedule_next(self):
|
||||||
if self._running:
|
if self._running:
|
||||||
|
current_time = time.time()
|
||||||
|
while self._next_timeout < current_time:
|
||||||
self._next_timeout += self.callback_time / 1000.0
|
self._next_timeout += self.callback_time / 1000.0
|
||||||
self.io_loop.add_timeout(self._next_timeout, self._run)
|
self.io_loop.add_timeout(self._next_timeout, self._run)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue