From fe1099f831671d5cc4ddbe8d2c1b4795f9af0373 Mon Sep 17 00:00:00 2001 From: Hizkia Felix Date: Wed, 27 Jul 2022 10:38:55 +0800 Subject: [PATCH] fix(aiohttp): sleep for 250ms after close (#30) Fixes #29 --- fc2_live_dl/FC2LiveDL.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fc2_live_dl/FC2LiveDL.py b/fc2_live_dl/FC2LiveDL.py index 64097f3..f50556d 100644 --- a/fc2_live_dl/FC2LiveDL.py +++ b/fc2_live_dl/FC2LiveDL.py @@ -80,6 +80,10 @@ async def __aenter__(self): async def __aexit__(self, *err): self._logger.trace("exit", err) await self._session.close() + # Sleep for 250ms to allow SSL connections to close. + # See: https://github.com/aio-libs/aiohttp/issues/1925 + # See: https://github.com/aio-libs/aiohttp/issues/4324 + await asyncio.sleep(0.250) self._session = None async def download(self, channel_id):