pierrejeambrun commented on code in PR #51638:
URL: https://github.com/apache/airflow/pull/51638#discussion_r2144951588
##########
airflow-core/src/airflow/api_fastapi/core_api/routes/public/dag_run.py:
##########
@@ -421,6 +421,21 @@ def trigger_dag_run(
state=DagRunState.QUEUED,
session=session,
)
+
+ if dag_deadline := dag.get_dagrun_deadline():
+ Deadline.add_deadline(
+ Deadline(
+ deadline=dag_deadline.reference.evaluate_with(
+ interval=dag_deadline.interval,
+ dag_id=dag.dag_id,
+ ),
+ callback=dag_deadline.callback,
+ callback_kwargs=dag_deadline.callback_kwargs or {},
+ dag_id=dag.dag_id,
+ dagrun_id=dag_run.run_id,
+ )
+ )
+
Review Comment:
There are other places where we 'create' a dagrun, should all those places
also handle the associated deadline creation, or is that specific to this
endpoint?
(We can name `trigger_dag` that is used in the command line or execution
api, some other places calling `dag.create_dagrun` which will not create the
deadline like we are doing here)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]