anthonyp97 commented on code in PR #26347:
URL: https://github.com/apache/airflow/pull/26347#discussion_r975723281
##########
airflow/jobs/scheduler_job.py:
##########
@@ -1227,6 +1222,19 @@ def _update_state(dag: DAG, dag_run: DagRun):
active_runs_of_dags[dag_run.dag_id] += 1
_update_state(dag, dag_run)
+ @retry_db_transaction
+ def _schedule_all_dag_runs(self, guard, dag_runs, session):
+ """Makes scheduling decisions for all `dag_runs`"""
+ callback_tuples = []
+ callback_to_run = None
+ for dag_run in dag_runs:
+ callback_to_run = self._schedule_dag_run(dag_run, session)
+ callback_tuples.append((dag_run, callback_to_run))
+
+ guard.commit()
+
+ return callback_tuples, callback_to_run
Review Comment:
@blag yea definitely right that I should just be returning
`callback_tuples`, will update this. For the second point I imagine it
shouldn't really matter between list of tuples and a dict since we are just
iterating through the data structure either way element by element but if you
strongly prefer a dict I can update to use that.
--
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]