potiuk commented on a change in pull request #21901:
URL: https://github.com/apache/airflow/pull/21901#discussion_r821709950
##########
File path: airflow/jobs/scheduler_job.py
##########
@@ -1072,8 +1073,7 @@ def _schedule_dag_run(
self.log.info("Run %s of %s has timed-out", dag_run.run_id,
dag_run.dag_id)
active_runs = dag.get_num_active_runs(only_running=False,
session=session)
# Work out if we should allow creating a new DagRun now?
- if self._should_update_dag_next_dagruns(dag, dag_model,
active_runs):
- dag_model.calculate_dagrun_date_fields(dag,
dag.get_run_data_interval(dag_run))
+ self._max_active_runs_reached(dag, dag_model, active_runs)
Review comment:
I suggest to rename it to `_update_max_active_runs_reached` - this
function has two behaviours - update and return the updated value, I think
"update" is more important and returning the value is really an optimisation of
the value retrieval.
--
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]