Run in executor

This commit is contained in:
retoor 2024-12-03 04:31:06 +01:00
parent 327180d106
commit b569a1ea15

View File

@ -32,7 +32,7 @@ async def get_recent_rants(start_from=1, page_size=10):
def get_rants(): def get_rants():
return dr.get_rants("recent", page_size, start_from)["rants"] return dr.get_rants("recent", page_size, start_from)["rants"]
rants = asyncio.wait_for(loop.run_in_executor(get_rants), 5) rants = asyncio.wait_for(loop.run_in_executor(None,get_rants), 5)
page += 1 page += 1
for rant in rants: for rant in rants: