Function cant pass to next line because of asyncio.sleep. There is rest of the code but i will share just 3 lines. It explains everything. Console doesnt print 0 to console. If i move print(0) above of asyncio.sleep it prints to console.
async def getHistory(self): logging.info(f"Getting history for {self.parite}...") await asyncio.sleep(1) print(0) async def get_histories(): for parite in parite_list: asyncio.create_task(parite.getHistory()) asyncio.run(get_histories())
sleep. But after 1 second it continues, if the event loop is still running, which it isn't in your case.