XD-DENG commented on a change in pull request #12815:
URL: https://github.com/apache/airflow/pull/12815#discussion_r536281711



##########
File path: airflow/models/dag.py
##########
@@ -1966,7 +1966,7 @@ def deactivate_stale_dags(expiration_date, session=None):
             )
             dag.is_active = False
             session.merge(dag)
-            session.commit()
+        session.commit()

Review comment:
       Similar to `deactivate_unknown_dags()`, commit only once outside the 
for-loop.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to