mirror of
https://github.com/eternnoir/pyTelegramBotAPI.git
synced 2023-08-10 21:12:57 +03:00
Add more accurate control over threads count
This commit is contained in:
parent
d29c816b79
commit
e138d2e1ef
@ -44,7 +44,7 @@ class TeleBot:
|
|||||||
getUpdates
|
getUpdates
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, token, threaded=True, skip_pending=False):
|
def __init__(self, token, threaded=True, skip_pending=False, num_threads=2):
|
||||||
"""
|
"""
|
||||||
:param token: bot API token
|
:param token: bot API token
|
||||||
:return: Telebot object.
|
:return: Telebot object.
|
||||||
@ -75,7 +75,7 @@ class TeleBot:
|
|||||||
|
|
||||||
self.threaded = threaded
|
self.threaded = threaded
|
||||||
if self.threaded:
|
if self.threaded:
|
||||||
self.worker_pool = util.ThreadPool()
|
self.worker_pool = util.ThreadPool(num_threads=num_threads)
|
||||||
|
|
||||||
def set_webhook(self, url=None, certificate=None, max_connections=None, allowed_updates=None):
|
def set_webhook(self, url=None, certificate=None, max_connections=None, allowed_updates=None):
|
||||||
return apihelper.set_webhook(self.token, url, certificate, max_connections, allowed_updates)
|
return apihelper.set_webhook(self.token, url, certificate, max_connections, allowed_updates)
|
||||||
|
Loading…
Reference in New Issue
Block a user