Skip to content

Commit

Permalink
per aiohttps docs, add 250ms sleep at event loop close to avoid Resou…
Browse files Browse the repository at this point in the history
…rceWarning
  • Loading branch information
scivision committed Feb 25, 2021
1 parent 9e873bd commit bd50af6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/linkcheckmd/coro.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ async def check_urls(

warnings.resetwarnings()

# this is per aiohttp manual, when using HTTPS SSL sites, just before closing
# the event loop, do a 250ms sleep (not for each site)
await asyncio.sleep(0.250)

return list(itertools.chain(*urls)) # flatten list of lists


Expand Down

0 comments on commit bd50af6

Please sign in to comment.