fat-catTW commented on code in PR #72715:
URL: https://github.com/apache/airflow/pull/72715#discussion_r4371777913


##########
airflow-core/src/airflow/api_fastapi/core_api/routes/public/dag_bundles.py:
##########
@@ -435,3 +440,26 @@ def get_dag_bundle_files(
         dag_bundle_files=[DagBundleFileResponse(**row) for row in 
ordered[start:end]],
         total_entries=len(ordered),
     )
+
+
+@dag_bundles_router.post(
+    "/{bundle_name}/refresh",
+    status_code=status.HTTP_202_ACCEPTED,
+    responses=create_openapi_http_exception_doc([status.HTTP_404_NOT_FOUND]),
+    dependencies=[Depends(action_logging()), 
Depends(requires_access_dag_bundle(method="PUT"))],
+)
+def refresh_dag_bundle(bundle_name: str, session: SessionDep) -> 
DagBundleRefreshResponse:
+    """Request an asynchronous Dag bundle refresh."""
+    try:
+        with session.begin_nested():
+            session.add(
+                DagPriorityParsingRequest(
+                    bundle_name=bundle_name,
+                    relative_fileloc=None,
+                )
+            )
+            session.flush()
+    except IntegrityError:
+        # The deterministic request key means an equivalent refresh is already 
pending.
+        pass

Review Comment:
   Updated!



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