Skip to content

Commit d192b38

Browse files
committed
dispatcher: add comment to describe the reason for conpool size
1 parent f0b2028 commit d192b38

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

telegram/ext/dispatcher.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,11 @@ def __init__(self, bot, update_queue, workers=4, exception_event=None, job_queue
121121
if request.is_con_pool_initialized():
122122
raise RuntimeError('Connection Pool already initialized')
123123

124+
# we need a connection pool the size of:
125+
# * for each of the workers
126+
# * 1 for Dispatcher
127+
# * 1 for polling Updater (even if updater is webhook, we can spare a connection)
128+
# * 1 for JobQueue
124129
request.CON_POOL_SIZE = workers + 3
125130
for i in range(workers):
126131
thread = Thread(target=_pooled, name=str(i))

0 commit comments

Comments
 (0)