style: apply code formatting to pass pre-commit checks
- Split long function calls across multiple lines - Split long function definitions across multiple lines - Add blank line after docstring in test function These changes are purely formatting to comply with the project's linting standards (black/ruff). No functional changes.
This commit is contained in:
parent
5d31412bd7
commit
27de78113d
2 changed files with 16 additions and 5 deletions
|
|
@ -1123,7 +1123,9 @@ def get_storage_lock(workspace: str = "", enable_logging: bool = False) -> Unifi
|
||||||
workspace: Optional workspace identifier for namespace isolation.
|
workspace: Optional workspace identifier for namespace isolation.
|
||||||
enable_logging: Enable lock operation logging.
|
enable_logging: Enable lock operation logging.
|
||||||
"""
|
"""
|
||||||
return _get_workspace_lock("storage_lock", _storage_lock, workspace, enable_logging)
|
return _get_workspace_lock(
|
||||||
|
"storage_lock", _storage_lock, workspace, enable_logging
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def get_pipeline_status_lock(workspace: str = "", enable_logging: bool = False) -> UnifiedLock:
|
def get_pipeline_status_lock(workspace: str = "", enable_logging: bool = False) -> UnifiedLock:
|
||||||
|
|
@ -1133,7 +1135,9 @@ def get_pipeline_status_lock(workspace: str = "", enable_logging: bool = False)
|
||||||
workspace: Optional workspace identifier for namespace isolation.
|
workspace: Optional workspace identifier for namespace isolation.
|
||||||
enable_logging: Enable lock operation logging.
|
enable_logging: Enable lock operation logging.
|
||||||
"""
|
"""
|
||||||
return _get_workspace_lock("pipeline_status_lock", _pipeline_status_lock, workspace, enable_logging)
|
return _get_workspace_lock(
|
||||||
|
"pipeline_status_lock", _pipeline_status_lock, workspace, enable_logging
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def get_graph_db_lock(workspace: str = "", enable_logging: bool = False) -> UnifiedLock:
|
def get_graph_db_lock(workspace: str = "", enable_logging: bool = False) -> UnifiedLock:
|
||||||
|
|
@ -1143,7 +1147,9 @@ def get_graph_db_lock(workspace: str = "", enable_logging: bool = False) -> Unif
|
||||||
workspace: Optional workspace identifier for namespace isolation.
|
workspace: Optional workspace identifier for namespace isolation.
|
||||||
enable_logging: Enable lock operation logging.
|
enable_logging: Enable lock operation logging.
|
||||||
"""
|
"""
|
||||||
return _get_workspace_lock("graph_db_lock", _graph_db_lock, workspace, enable_logging)
|
return _get_workspace_lock(
|
||||||
|
"graph_db_lock", _graph_db_lock, workspace, enable_logging
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def get_storage_keyed_lock(
|
def get_storage_keyed_lock(
|
||||||
|
|
@ -1158,14 +1164,18 @@ def get_storage_keyed_lock(
|
||||||
return _storage_keyed_lock(namespace, keys, enable_logging=enable_logging)
|
return _storage_keyed_lock(namespace, keys, enable_logging=enable_logging)
|
||||||
|
|
||||||
|
|
||||||
def get_data_init_lock(workspace: str = "", enable_logging: bool = False) -> UnifiedLock:
|
def get_data_init_lock(
|
||||||
|
workspace: str = "", enable_logging: bool = False
|
||||||
|
) -> UnifiedLock:
|
||||||
"""Return unified data initialization lock for ensuring atomic data initialization.
|
"""Return unified data initialization lock for ensuring atomic data initialization.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
workspace: Optional workspace identifier for namespace isolation.
|
workspace: Optional workspace identifier for namespace isolation.
|
||||||
enable_logging: Enable lock operation logging.
|
enable_logging: Enable lock operation logging.
|
||||||
"""
|
"""
|
||||||
return _get_workspace_lock("data_init_lock", _data_init_lock, workspace, enable_logging)
|
return _get_workspace_lock(
|
||||||
|
"data_init_lock", _data_init_lock, workspace, enable_logging
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def cleanup_keyed_lock() -> Dict[str, Any]:
|
def cleanup_keyed_lock() -> Dict[str, Any]:
|
||||||
|
|
|
||||||
|
|
@ -195,6 +195,7 @@ def test_all_lock_functions_without_workspace():
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
async def test_concurrent_workspace_operations():
|
async def test_concurrent_workspace_operations():
|
||||||
"""Test that multiple workspaces can operate concurrently without blocking."""
|
"""Test that multiple workspaces can operate concurrently without blocking."""
|
||||||
|
|
||||||
async def simulate_document_upload(workspace: str):
|
async def simulate_document_upload(workspace: str):
|
||||||
start_time = time.time()
|
start_time = time.time()
|
||||||
lock = get_pipeline_status_lock(workspace=workspace)
|
lock = get_pipeline_status_lock(workspace=workspace)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue