mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2024-11-22 15:17:00 +01:00
Change Job.is_removed to be a property instead of a method
This commit is contained in:
parent
ed1785981d
commit
423251f66c
1 changed files with 3 additions and 2 deletions
|
@ -279,7 +279,7 @@ class JobQueue(object):
|
||||||
self._set_next_peek(t)
|
self._set_next_peek(t)
|
||||||
break
|
break
|
||||||
|
|
||||||
if job.is_removed():
|
if job.is_removed:
|
||||||
self.logger.debug('Removing job %s', job.name)
|
self.logger.debug('Removing job %s', job.name)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
@ -296,7 +296,7 @@ class JobQueue(object):
|
||||||
else:
|
else:
|
||||||
self.logger.debug('Skipping disabled job %s', job.name)
|
self.logger.debug('Skipping disabled job %s', job.name)
|
||||||
|
|
||||||
if job.repeat and not job.is_removed():
|
if job.repeat and not job.is_removed:
|
||||||
self._put(job, last_t=t)
|
self._put(job, last_t=t)
|
||||||
else:
|
else:
|
||||||
self.logger.debug('Dropping non-repeating or removed job %s', job.name)
|
self.logger.debug('Dropping non-repeating or removed job %s', job.name)
|
||||||
|
@ -427,6 +427,7 @@ class Job(object):
|
||||||
"""
|
"""
|
||||||
self._remove.set()
|
self._remove.set()
|
||||||
|
|
||||||
|
@property
|
||||||
def is_removed(self):
|
def is_removed(self):
|
||||||
return self._remove.is_set()
|
return self._remove.is_set()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue