yangdx commited on
Commit
7c2f5b5
·
1 Parent(s): b3d99dd

Process update flags status for proper boolean conversion

Browse files

- Convert MutableBoolean to regular boolean values
- Handle both multiprocess and single process cases

lightrag/api/routers/document_routes.py CHANGED
@@ -807,12 +807,24 @@ def create_document_routes(
807
 
808
  # Get update flags status for all namespaces
809
  update_status = await get_all_update_flags_status()
 
 
 
 
 
 
 
 
 
 
 
 
810
 
811
  # Convert to regular dict if it's a Manager.dict
812
  status_dict = dict(pipeline_status)
813
 
814
- # Add update_status to the status dictionary
815
- status_dict["update_status"] = update_status
816
 
817
  # Convert history_messages to a regular list if it's a Manager.list
818
  if "history_messages" in status_dict:
 
807
 
808
  # Get update flags status for all namespaces
809
  update_status = await get_all_update_flags_status()
810
+
811
+ # Convert MutableBoolean objects to regular boolean values
812
+ processed_update_status = {}
813
+ for namespace, flags in update_status.items():
814
+ processed_flags = []
815
+ for flag in flags:
816
+ # Handle both multiprocess and single process cases
817
+ if hasattr(flag, 'value'):
818
+ processed_flags.append(bool(flag.value))
819
+ else:
820
+ processed_flags.append(bool(flag))
821
+ processed_update_status[namespace] = processed_flags
822
 
823
  # Convert to regular dict if it's a Manager.dict
824
  status_dict = dict(pipeline_status)
825
 
826
+ # Add processed update_status to the status dictionary
827
+ status_dict["update_status"] = processed_update_status
828
 
829
  # Convert history_messages to a regular list if it's a Manager.list
830
  if "history_messages" in status_dict: