Skip to content

Commit

Permalink
Run non-markdown tasks in new event loop
Browse files Browse the repository at this point in the history
  • Loading branch information
johnfraney committed Apr 2, 2024
1 parent de4b44f commit baf2554
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion blurry/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,10 @@ async def build(release=True):
print(f"Blurring {len(markdown_tasks)} Markdown files from: {content_dir_relative}")

await asyncio.gather(*markdown_tasks)
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
for non_markdown_task in non_markdown_tasks:
await asyncio.to_thread(lambda: asyncio.run(non_markdown_task))
await asyncio.to_thread(lambda: loop.run_until_complete(non_markdown_task))

end = datetime.now()

Expand Down

0 comments on commit baf2554

Please sign in to comment.