Actually, don't give contexts to timers that aren't contextual. (e.g. pesistent
timers)
This commit is contained in:
parent
33921a8912
commit
5e3399f73e
1 changed files with 2 additions and 2 deletions
|
@ -36,7 +36,7 @@ class TimersContext(object):
|
||||||
self._parent._add(self.context, name, delay, next_due, None, False,
|
self._parent._add(self.context, name, delay, next_due, None, False,
|
||||||
kwargs)
|
kwargs)
|
||||||
def add_persistent(self, name, delay, next_due=None, **kwargs):
|
def add_persistent(self, name, delay, next_due=None, **kwargs):
|
||||||
self._parent._add(self.context, name, delay, next_due, None, True,
|
self._parent._add(None, name, delay, next_due, None, True,
|
||||||
kwargs)
|
kwargs)
|
||||||
|
|
||||||
class Timers(object):
|
class Timers(object):
|
||||||
|
@ -61,7 +61,7 @@ class Timers(object):
|
||||||
"name": timer.name, "delay": timer.delay,
|
"name": timer.name, "delay": timer.delay,
|
||||||
"next-due": timer.next_due, "kwargs": timer.kwargs})
|
"next-due": timer.next_due, "kwargs": timer.kwargs})
|
||||||
def _remove(self, timer):
|
def _remove(self, timer):
|
||||||
if timer.context and timer.context in self.context_timers:
|
if timer.context:
|
||||||
self.context_timers[timer.context].remove(timer)
|
self.context_timers[timer.context].remove(timer)
|
||||||
if not self.context_timers[timer.context]:
|
if not self.context_timers[timer.context]:
|
||||||
del self.context_timers[timer.conteext]
|
del self.context_timers[timer.conteext]
|
||||||
|
|
Loading…
Reference in a new issue