jedcunningham commented on code in PR #46501:
URL: https://github.com/apache/airflow/pull/46501#discussion_r1944161540


##########
airflow/dag_processing/bundles/base.py:
##########
@@ -112,3 +125,22 @@ def view_url(self, version: str | None = None) -> str | 
None:
         :param version: Version to view
         :return: URL to view the bundle
         """
+
+    @contextmanager
+    def lock(self):
+        if self._locked:
+            yield
+            return
+
+        lock_dir_path = self._dag_bundle_root_storage_path / "locks"
+        lock_dir_path.mkdir(parents=True, exist_ok=True)
+        lock_file_path = lock_dir_path / f"{self.name}.lock"
+        with open(lock_file_path, "w") as lock_file:

Review Comment:
   The nice thing about `w` is I don't have to create the file ahead of time. 
But no strong opinion here.



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