Matt Delacour
06/29/2022, 2:18 PMIntervalSchedule
object. Would the flows start at different time or all at the same time ?
What I am looking for is to distribute the load on our servers when flows run. And so a new flow should start at a random time and then follow the IntervalSchedule
constraint.James Sopkin
06/29/2022, 2:36 PMimport pendulum
from prefect.schedules import Schedule, clocks
schedule = Schedule(clocks=clocks.CronClock(
"0 0 * * *",
start_date=pendulum.now("US/Central")
)
schedule2 = Schedule(clocks=clocks.CronClock(
"0 12 * * *",
start_date=pendulum.now("US/Central")
)
Matt Delacour
07/13/2022, 7:59 PMwith Flow(
"flow_name",
schedule=IntervalSchedule(
interval=timedelta(hours=12),
),
) as flow:
...
Does that make sense to you ?James Sopkin
07/18/2022, 4:26 PMMatt Delacour
07/19/2022, 5:16 PMSo try spacing the flows out with different starting times to reduce the load on your infrastructureYes I guess, I will go with a random function for the start time to schedule the jobs. Might want to do it deterministically (eg: using the name of the flow)