Anjaneyulu K
11/08/2022, 10:29 PM@flow(name="Status check")
def run():
a= "hello"
if(condition):
success
else:
run()
if __name__ == "__main__":
run()
Can anyone helpAnna Geller
11/08/2022, 11:58 PMAnjaneyulu K
11/08/2022, 11:59 PM@flow(name="Status check")
def run():
a= task1 output
if(task1 output condition):
running task2
else:
wait(10)
run()
Anna Geller
11/09/2022, 12:02 AMAnjaneyulu K
11/09/2022, 12:22 AMfrom prefect import task, flow
import time
import random
from prefect.deployments import Deployment
@task
def getNumber(x):
return x
@task
def hello():
print("Hello world")
@flow(name="Status check")
def run(x):
a= getNumber(x)
if a == 2:
hello()
else:
time.sleep(5)
run(x)
if __name__ == "__main__":
run(random.randint(0,9))
deployment = Deployment.build_from_flow(
flow=run,
name="ex-dep2",
version=1,
work_queue_name="demo-exp1"
)
deployment.apply()
Anna Geller
11/09/2022, 2:42 AM