reuse lbrycrd connector

This commit is contained in:
Jack Robison 2019-06-28 13:47:27 -04:00
parent 66122a45ed
commit 8b0d96acba
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2

View file

@ -55,6 +55,7 @@ class Daemon:
self.max_retry = max_retry
self._height = None
self.available_rpcs = {}
self.connector = aiohttp.TCPConnector()
def set_url(self, url):
"""Set the URLS to the given list, and switch to the first one."""
@ -89,7 +90,7 @@ class Daemon:
def client_session(self):
"""An aiohttp client session."""
return aiohttp.ClientSession()
return aiohttp.ClientSession(connector=self.connector, connector_owner=False)
async def _send_data(self, data):
async with self.workqueue_semaphore: