Create a default TCPConnector with no limit

The default implementation only allows for 100 concurrent connections
and during heavy sharding (>=100 shards) this can end up freezing
shards.
This commit is contained in:
Rapptz 2022-03-07 01:19:37 -05:00
parent e63c9bad85
commit 0330282c5f

View File

@ -324,7 +324,7 @@ class HTTPClient:
unsync_clock: bool = True,
) -> None:
self.loop: asyncio.AbstractEventLoop = asyncio.get_event_loop() if loop is None else loop
self.connector = connector
self.connector: aiohttp.BaseConnector = connector or aiohttp.TCPConnector(limit=0)
self.__session: aiohttp.ClientSession = MISSING # filled in static_login
self._locks: weakref.WeakValueDictionary = weakref.WeakValueDictionary()
self._global_over: asyncio.Event = asyncio.Event()