X Tutup
Skip to content

Commit fd7baa2

Browse files
committed
updater.py: use _init_thread for webhook as well
1 parent 4945d99 commit fd7baa2

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

telegram/updater.py

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -160,20 +160,10 @@ def start_webhook(self,
160160
if not self.running:
161161
self.running = True
162162

163-
# Create Thread objects
164-
dispatcher_thread = Thread(target=self.dispatcher.start,
165-
name="dispatcher")
166-
updater_thread = Thread(target=self._start_webhook,
167-
name="updater",
168-
args=(listen,
169-
port,
170-
url_path,
171-
cert,
172-
key))
173-
174-
# Start threads
175-
dispatcher_thread.start()
176-
updater_thread.start()
163+
# Create & start threads
164+
self._init_thread(self.dispatcher.start, "dispatcher"),
165+
self._init_thread(self._start_webhook, "updater", listen,
166+
port, url_path, cert, key)
177167

178168
# Return the update queue so the main thread can insert updates
179169
return self.update_queue

0 commit comments

Comments
 (0)
X Tutup