close daemon connector on server close to avoid errors on tests
This commit is contained in:
parent
510d88fff1
commit
8749c78622
2 changed files with 6 additions and 0 deletions
|
@ -57,6 +57,11 @@ class Daemon:
|
|||
self.available_rpcs = {}
|
||||
self.connector = aiohttp.TCPConnector()
|
||||
|
||||
async def close(self):
|
||||
if self.connector:
|
||||
await self.connector.close()
|
||||
self.connector = None
|
||||
|
||||
def set_url(self, url):
|
||||
"""Set the URLS to the given list, and switch to the first one."""
|
||||
urls = url.split(',')
|
||||
|
|
|
@ -146,6 +146,7 @@ class Server:
|
|||
task.cancel()
|
||||
await asyncio.wait(self.cancellable_tasks)
|
||||
self.shutdown_event.set()
|
||||
await self.daemon.close()
|
||||
|
||||
def run(self):
|
||||
loop = asyncio.get_event_loop()
|
||||
|
|
Loading…
Reference in a new issue