mirror of
https://github.com/RYGhub/royalnet.git
synced 2025-02-25 06:05:03 +00:00
Remove Telegram API requests timeout
This commit is contained in:
parent
b12dcf3ff5
commit
2ffab612f5
1 changed files with 11 additions and 16 deletions
|
@ -131,12 +131,7 @@ class Bot:
|
||||||
|
|
||||||
async def api_request(self, endpoint, **params):
|
async def api_request(self, endpoint, **params):
|
||||||
"""Send a request to the Telegram API at the specified endpoint."""
|
"""Send a request to the Telegram API at the specified endpoint."""
|
||||||
if "timeout" in params:
|
# TODO: Reintroduce the timeout to prevent stuck requests
|
||||||
t = params["timeout"] + 5
|
|
||||||
else:
|
|
||||||
# Default timeout is 5 seconds.
|
|
||||||
t = 5
|
|
||||||
with async_timeout.timeout(t):
|
|
||||||
# Create a new session for each request.
|
# Create a new session for each request.
|
||||||
async with aiohttp.ClientSession() as session:
|
async with aiohttp.ClientSession() as session:
|
||||||
# Send the request to the Telegram API
|
# Send the request to the Telegram API
|
||||||
|
|
Loading…
Add table
Reference in a new issue