Skip to content

Commit

Permalink
Update apps.py
Browse files Browse the repository at this point in the history
  • Loading branch information
JungDev authored Jan 2, 2019
1 parent f16e49e commit 898142e
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions django_telegrambot/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,22 +167,22 @@ def ready(self):

allowed_updates = b.get('ALLOWED_UPDATES', None)
timeout = b.get('TIMEOUT', None)
proxy = b.get('PROXY', None)
proxy = b.get('PROXY', None)

if self.mode == WEBHOOK_MODE:
try:
if b.get('MESSAGEQUEUE_ENABLED',False):
q = mq.MessageQueue(all_burst_limit=b.get('MESSAGEQUEUE_ALL_BURST_LIMIT',29),
all_time_limit_ms=b.get('MESSAGEQUEUE_ALL_TIME_LIMIT_MS',1024))
if proxy:
request = Request(proxy_url=proxy['proxy_url'], urllib3_proxy_kwargs=proxy['urllib3_proxy_kwargs'], con_pool_size=b.get('MESSAGEQUEUE_REQUEST_CON_POOL_SIZE',8))
else:
request = Request(con_pool_size=b.get('MESSAGEQUEUE_REQUEST_CON_POOL_SIZE',8))
bot = MQBot(token, request=request, mqueue=q)
else:
request = None
if proxy:
request = Request(proxy_url=proxy['proxy_url'], urllib3_proxy_kwargs=proxy['urllib3_proxy_kwargs'])
all_time_limit_ms=b.get('MESSAGEQUEUE_ALL_TIME_LIMIT_MS',1024))
if proxy:
request = Request(proxy_url=proxy['proxy_url'], urllib3_proxy_kwargs=proxy['urllib3_proxy_kwargs'], con_pool_size=b.get('MESSAGEQUEUE_REQUEST_CON_POOL_SIZE',8))
else:
request = Request(con_pool_size=b.get('MESSAGEQUEUE_REQUEST_CON_POOL_SIZE',8))
bot = MQBot(token, request=request, mqueue=q)
else:
request = None
if proxy:
request = Request(proxy_url=proxy['proxy_url'], urllib3_proxy_kwargs=proxy['urllib3_proxy_kwargs'])
bot = telegram.Bot(token=token, request=request)

DjangoTelegramBot.dispatchers.append(Dispatcher(bot, None, workers=0))
Expand Down

0 comments on commit 898142e

Please sign in to comment.