Matt Delacour06/29/2022, 2:18 PM
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
James Sopkin06/29/2022, 2:36 PM
import 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 Delacour07/13/2022, 7:59 PM
Does that make sense to you ?
with Flow( "flow_name", schedule=IntervalSchedule( interval=timedelta(hours=12), ), ) as flow: ...
James Sopkin07/18/2022, 4:26 PM
Matt Delacour07/19/2022, 5:16 PM
So 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)