mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2025-01-08 19:34:12 +01:00
fix/hack Updater.stop() not working on extreme cases
during test_bootstrap_retries_fail() there is an exception raised (by design): TelegramError('test') For a reason I haven't managed to pinpoint the above exception in its precise timing caused the Updater to be left in a state which is 'self.running == False', but the dispatcher threads already initialized. This patch identifies this extreme case and makes sure to go over the stop procedure.
This commit is contained in:
parent
cb6ddfded5
commit
881d1d0e25
1 changed files with 1 additions and 1 deletions
|
@ -346,7 +346,7 @@ class Updater(object):
|
|||
|
||||
self.job_queue.stop()
|
||||
with self.__lock:
|
||||
if self.running:
|
||||
if self.running or dispatcher.ASYNC_THREADS:
|
||||
self.logger.debug('Stopping Updater and Dispatcher...')
|
||||
|
||||
self.running = False
|
||||
|
|
Loading…
Reference in a new issue