wave
June 2, 2022, 8:10pm
1
I have a simple ‘Hello world!’ code with schedule. But when I run the code I always get “'late runs” and “yellow graph” as in the screenshot
Question: How to set the status “successfully” at the end of the task and get a green graph?
from prefect import task, Flow
from datetime import timedelta
from prefect.schedules import IntervalSchedule
@task
def say_hello():
print("Hello, world!")
schedule = IntervalSchedule(interval=timedelta(minutes=1))
with Flow("Hello", schedule=schedule) as flow:
say_hello()
flow.register(project_name='Lesson')
flow.run()
1 Like
Do you have an agent querying for tasks, e.g. prefect agent local start
1 Like
Also, it would be best if you remove both of those lines:
and use Prefect CLI instead:
prefect register --project Lesson -p yourflow.py
prefect run -p yourflow.py
Then, as Andrew mentioned, you would need to actually start an agent, which you can do using:
prefect agent local start
wave
June 3, 2022, 4:14pm
4
I transferred the project to a vps, and launched both the project and the agent there. It works! But it refuses to work in my local pc and freezes at the moment “Waiting for flow runs…”
In the end, I found what I was looking for. Thanks!
1 Like