scheduler: fix error when ended task has been already removed
This commit is contained in:
parent
be990c150f
commit
e1196bc30a
1 changed files with 6 additions and 2 deletions
|
|
@ -82,8 +82,12 @@ class Scheduler(IScheduler):
|
||||||
def _repeat_callback(self, count, interval, function, args):
|
def _repeat_callback(self, count, interval, function, args):
|
||||||
function(*args)
|
function(*args)
|
||||||
with self.mutex:
|
with self.mutex:
|
||||||
e = self.queue[count]
|
try:
|
||||||
self.logger.debug('function "%s" will be called in %s seconds' % (function.__name__, e.interval))
|
e = self.queue[count]
|
||||||
|
except KeyError:
|
||||||
|
return
|
||||||
|
else:
|
||||||
|
self.logger.debug('function "%s" will be called in %s seconds' % (function.__name__, e.interval))
|
||||||
|
|
||||||
def cancel(self, ev):
|
def cancel(self, ev):
|
||||||
with self.mutex:
|
with self.mutex:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue