Skip to content

Commit e9ba2fd

Browse files
committed
Polling timeout fix
1 parent 8203fa5 commit e9ba2fd

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

telebot/apihelper.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,11 @@ def _make_request(token, method_name, method='get', params=None, files=None):
6969
if 'connect-timeout' in params:
7070
connect_timeout = params.pop('connect-timeout') + 10
7171
if 'long_polling_timeout' in params:
72-
# For getUpdates: the only function with timeout on the BOT API side
72+
# For getUpdates
73+
# The only function with timeout on the BOT API side
7374
params['timeout'] = params.pop('long_polling_timeout')
75+
# Long polling hangs for given time. Read timeout should be greater that long_polling_timeout
76+
read_timeout = max(params['timeout'] + 10, read_timeout)
7477

7578

7679
result = None

telebot/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Versions should comply with PEP440.
22
# This line is parsed in setup.py:
3-
__version__ = '3.7.5.u2'
3+
__version__ = '3.7.5.u3'

0 commit comments

Comments
 (0)