alins
12/04/2021, 8:07 AMimport datetime
import os
import pendulum
import time
from prefect import Flow, task
from prefect.schedules import CronSchedule
from prefect.tasks.airtable import WriteAirtableRow
from prefect.tasks.github import GetRepoInfo
from prefect.triggers import any_failed
@task
def my_process():
time.sleep(70)
daily_schedule = CronSchedule("*/1 * * * *")
with Flow("sleep more than cron", schedule=daily_schedule) as flow:
my_process()
flow.run()
while i run this with python3 flow.py
this run and wait 70 second till end and the task start again (it takes two minutes run every task) but i want it run every minutes and don't care about the time of the process need to finishedAmanda Wee
12/04/2021, 8:36 AMflow.run()
you might consider registering the flow to Prefect Cloud (or Server), and then running a Prefect agent that will handle the running of the flow according to the schedule.alins
12/04/2021, 8:38 AMAmanda Wee
12/04/2021, 8:39 AMalins
12/04/2021, 8:42 AM