David N05/12/2020, 6:01 PM
state to finish.
David N05/12/2020, 6:09 PM
again, no code changes needed)
David N05/12/2020, 6:17 PM
then we execute the python scipt, the process runs "forever", and kicks the flow off every 300 secs.
with Flow('flow-name', schedule=schedules.IntervalSchedule(interval=timedelta(seconds=300))) as flow: t1=func() t2=func2(t1) flow.run()
David N05/12/2020, 6:18 PM
Jim Crist-Harif05/12/2020, 6:32 PM
, see https://docs.prefect.io/core/concepts/schedules.html#complex-schedules). You'd want the schedule to respond to some external event (perhaps an os signal, perhaps it starts an http server and waits for a ping, perhaps it watches a file on disk for changes, up to you). When notified, it'd filter any newly scheduled events. Something like (pseudocode):
def myfilter(event): if shouldnt_schedule_more_runs(): return False return True schedule = Schedule(..., filters=[myfilter])
David N05/12/2020, 7:09 PM