This commit is contained in:
Jannes Höke 2015-12-31 15:03:40 +01:00
parent 29a4062945
commit 3e1cb08567
2 changed files with 13 additions and 7 deletions

View file

@ -182,10 +182,11 @@ class Dispatcher:
# Dispatch any errors # Dispatch any errors
except TelegramError as te: except TelegramError as te:
self.logger.warn("Error was raised while processing Update.") self.logger.warn("Error was raised while processing "
"Update.")
self.dispatchError(update, te) self.dispatchError(update, te)
# All other errors should not stop the thread, so just print them # All other errors should not stop the thread, just print them
except: except:
print_exc() print_exc()
else: else:

View file

@ -105,9 +105,10 @@ class Updater:
dispatcher_thread = Thread(target=self.dispatcher.start, dispatcher_thread = Thread(target=self.dispatcher.start,
name="dispatcher") name="dispatcher")
updater_thread = Thread(target=self._start_polling, updater_thread = Thread(target=self._start_polling,
name="updater", name="updater",
args=(poll_interval, timeout, args=(poll_interval,
network_delay)) timeout,
network_delay))
# Start threads # Start threads
dispatcher_thread.start() dispatcher_thread.start()
@ -148,8 +149,12 @@ class Updater:
dispatcher_thread = Thread(target=self.dispatcher.start, dispatcher_thread = Thread(target=self.dispatcher.start,
name="dispatcher") name="dispatcher")
updater_thread = Thread(target=self._start_webhook, updater_thread = Thread(target=self._start_webhook,
name="updater", name="updater",
args=(listen, port, url_path, cert, key)) args=(listen,
port,
url_path,
cert,
key))
# Start threads # Start threads
dispatcher_thread.start() dispatcher_thread.start()