Tadej Svetina
01/08/2023, 9:28 PMasyncio.sleep
to wait between querying the API. Running of this task occupies 100% of the CPU - how can I fix this?submit
- so there must be a problem with the task runner.import asyncio
import prefect
@prefect.task
async def sleepy():
while True:
print("Hi")
await asyncio.sleep(10)
@prefect.flow
async def sleepy_flow():
await sleepy.submit()
asyncio.run(sleepy_flow())
George Coyne
01/10/2023, 3:50 PMTadej Svetina
01/10/2023, 4:13 PMZanie
01/10/2023, 4:13 PM