updater.py: use _init_thread for webhook as well

This commit is contained in:
Noam Meltzer 2016-02-09 23:05:50 +02:00
parent 4945d99de6
commit fd7baa2236

View file

@ -160,20 +160,10 @@ class Updater:
if not self.running:
self.running = True
# Create Thread objects
dispatcher_thread = Thread(target=self.dispatcher.start,
name="dispatcher")
updater_thread = Thread(target=self._start_webhook,
name="updater",
args=(listen,
port,
url_path,
cert,
key))
# Start threads
dispatcher_thread.start()
updater_thread.start()
# Create & start threads
self._init_thread(self.dispatcher.start, "dispatcher"),
self._init_thread(self._start_webhook, "updater", listen,
port, url_path, cert, key)
# Return the update queue so the main thread can insert updates
return self.update_queue