Add pipeline status lock function for legacy compatibility

- Add get_pipeline_status_lock function
- Return NamespaceLock for consistency
- Support workspace parameter
- Enable logging option
- Legacy code compatibility

(cherry picked from commit 93d445dfdd)
This commit is contained in:
yangdx 2025-11-25 18:24:39 +08:00 committed by Raphaël MANSUY
parent 402d2f9a98
commit 851b45f726

View file

@ -1683,3 +1683,17 @@ def get_default_workspace() -> str:
"""
global _default_workspace
return _default_workspace
def get_pipeline_status_lock(
enable_logging: bool = False, workspace: str = None
) -> NamespaceLock:
"""Return unified storage lock for pipeline status data consistency.
This function is for compatibility with legacy code only.
"""
global _default_workspace
actual_workspace = workspace if workspace else _default_workspace
return get_namespace_lock(
"pipeline_status", workspace=actual_workspace, enable_logging=enable_logging
)