From 7ed0eac4c96017f7884106853e9d897ebdd412bf Mon Sep 17 00:00:00 2001 From: yangdx Date: Mon, 17 Nov 2025 06:16:26 +0800 Subject: [PATCH] Fix workspace filtering logic in get_all_update_flags_status MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • Handle namespaces with/without prefixes • Fix workspace matching logic --- lightrag/kg/shared_storage.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/lightrag/kg/shared_storage.py b/lightrag/kg/shared_storage.py index d7150130..576d6a8d 100644 --- a/lightrag/kg/shared_storage.py +++ b/lightrag/kg/shared_storage.py @@ -1371,11 +1371,19 @@ async def get_all_update_flags_status(workspace: str | None = None) -> Dict[str, result = {} async with get_internal_lock(): for namespace, flags in _update_flags.items(): - namespace_split = namespace.split(":") - if workspace and not namespace_split[0] == workspace: - continue - if not workspace and namespace_split[0]: - continue + # Check if namespace has a workspace prefix (contains ':') + if ":" in namespace: + # Namespace has workspace prefix like "space1:pipeline_status" + # Only include if workspace matches the prefix + namespace_split = namespace.split(":", 1) + if not workspace or namespace_split[0] != workspace: + continue + else: + # Namespace has no workspace prefix like "pipeline_status" + # Only include if we're querying the default (empty) workspace + if workspace: + continue + worker_statuses = [] for flag in flags: if _is_multiprocess: