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?Tadej Svetina
01/08/2023, 9:51 PMsubmit
- so there must be a problem with the task runner.Tadej Svetina
01/08/2023, 9:51 PMimport 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())
Tadej Svetina
01/08/2023, 9:51 PMGeorge Coyne
01/10/2023, 3:50 PMGeorge Coyne
01/10/2023, 3:50 PMTadej Svetina
01/10/2023, 4:13 PMZanie
Zanie