Skip to content

Commit

Permalink
dag processor manager, create separate method to fetch callbacks with…
Browse files Browse the repository at this point in the history
… retries to split up provide_session and retry_db_transaction
  • Loading branch information
michaelmicheal committed Mar 14, 2023
1 parent 73703bb commit 24c02c7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion airflow/dag_processing/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -678,9 +678,12 @@ def _run_parsing_loop(self):
else:
poll_time = 0.0

@retry_db_transaction
@provide_session
def _fetch_callbacks(self, max_callbacks: int, session: Session = NEW_SESSION):
self._fetch_callbacks_with_retries(max_callbacks, session)

@retry_db_transaction
def _fetch_callbacks_with_retries(self, max_callbacks: int, session: Session):
"""Fetches callbacks from database and add them to the internal queue for execution."""
self.log.debug("Fetching callbacks from the database.")
with prohibit_commit(session) as guard:
Expand Down

0 comments on commit 24c02c7

Please sign in to comment.