potiuk commented on a change in pull request #21731:
URL: https://github.com/apache/airflow/pull/21731#discussion_r820874918



##########
File path: airflow/dag_processing/manager.py
##########
@@ -591,6 +594,28 @@ def _run_parsing_loop(self):
                 else:
                     poll_time = 0.0
 
+    @provide_session
+    def _fetch_callbacks(self, max_callbacks: int, session: Session = 
NEW_SESSION):
+        """Fetches callbacks from database and add them to the internal pipe 
for execution."""
+        if not conf.getboolean("scheduler", "standalone_dag_processor"):
+            # Nothing to do if callbacks are not stored in the database
+            return

Review comment:
       ONe nit. Should we do it "outside" of the method call ? I find it a bit 
surprising that we "always" do "_fetch_callbacks" - moving the if outside will 
move the principles better and it will avoid needlessly creating a DB session.




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


Reply via email to