1

I want to write a DAG that will hit a REST API every 15 seconds. But the cron provided in schedule_interval is of format (* * * * *) where minimum dimension can be given in minutes. Is there an alternate way to resolve this?

While writing DAG I am providing schedule_interval param which takes a cron expression as shown below :

dag = DAG('trigger_api', description='TriggerAPI 15 sec interval', schedule_interval='* * * * *', start_date=datetime(2020, 1, 1), catchup=False)

Above DAG will run every minute, but I want to schedule it every 15 seconds.

Anwar
  • 11
  • 2
  • this is very unclear. what do you mean by writing a DAG? how is it related to the cron scheduling? seems like your question is unrelated to DAG and even airflow. and you are simply asking about calling a cron every 15 seconds. this should be your question but I am sure there are tons already out there. see: https://stackoverflow.com/questions/1034243/how-to-get-a-unix-script-to-run-every-15-seconds – Mathieu J. Mar 19 '20 at 07:14
  • DAG (Directed Acyclic Graph) in Apache Airflow : While writing DAG I am providing schedule_interval param which takes a cron expression as shown below : dag = DAG('trigger_api', description='TriggerAPI 15 sec interval', schedule_interval='* * * * *', start_date=datetime(2020, 1, 1), catchup=False) Above DAG will run every minute, but I want to schedule it every 15 seconds – Anwar Mar 19 '20 at 12:27

0 Answers0