uranusjr commented on code in PR #60938:
URL: https://github.com/apache/airflow/pull/60938#discussion_r2730639343
##########
airflow-core/src/airflow/dag_processing/manager.py:
##########
@@ -337,13 +337,15 @@ def deactivate_stale_dags(
to_deactivate.add(dag.dag_id)
if to_deactivate:
- deactivated_dagmodel = session.execute(
- update(DagModel)
- .where(DagModel.dag_id.in_(to_deactivate))
- .values(is_stale=True)
- .execution_options(synchronize_session="fetch")
- )
- deactivated = getattr(deactivated_dagmodel, "rowcount", 0)
+ deactivated = 0
+ for dag_id_chunk in chunks(list(to_deactivate), 1000):
Review Comment:
I’m a bit hesitant with the `list()` call here since it’d kill performance
is `to_deactivate` is large.
--
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]