Fix a minor mistake in the task handler

This commit is contained in:
Vincent Le Goff 2017-08-10 11:40:57 +02:00
parent 37c9d65a9d
commit 8ef50f3706

View file

@ -179,10 +179,7 @@ class TaskHandler(object):
"""
now = datetime.now()
for task_id, (date, callbac, args, kwargs) in self.tasks.items():
seconds = (date - now).total_seconds()
if seconds < 0:
seconds = 0
seconds = max(0, (date - now).total_seconds())
task.deferLater(reactor, seconds, self.do_task, task_id)