diff --git a/api/core/datasource/entities/datasource_entities.py b/api/core/datasource/entities/datasource_entities.py index 2c3de1e5d7..f1179e4514 100644 --- a/api/core/datasource/entities/datasource_entities.py +++ b/api/core/datasource/entities/datasource_entities.py @@ -226,9 +226,9 @@ class OnlineDocumentInfo(BaseModel): Online document info """ - workspace_id: str = Field(..., description="The workspace id") - workspace_name: str = Field(..., description="The workspace name") - workspace_icon: str = Field(..., description="The workspace icon") + workspace_id: Optional[str] = Field(None, description="The workspace id") + workspace_name: Optional[str] = Field(None, description="The workspace name") + workspace_icon: Optional[str] = Field(None, description="The workspace icon") total: int = Field(..., description="The total number of documents") pages: list[OnlineDocumentPage] = Field(..., description="The pages of the online document") diff --git a/api/core/workflow/nodes/knowledge_index/entities.py b/api/core/workflow/nodes/knowledge_index/entities.py index 18a4f93970..85c0f695c6 100644 --- a/api/core/workflow/nodes/knowledge_index/entities.py +++ b/api/core/workflow/nodes/knowledge_index/entities.py @@ -107,10 +107,10 @@ class OnlineDocumentInfo(BaseModel): """ provider: str - workspace_id: str + workspace_id: Optional[str] = None page_id: str page_type: str - icon: OnlineDocumentIcon + icon: Optional[OnlineDocumentIcon] = None class WebsiteInfo(BaseModel): diff --git a/api/services/dataset_service.py b/api/services/dataset_service.py index 9e55549342..2de33761f2 100644 --- a/api/services/dataset_service.py +++ b/api/services/dataset_service.py @@ -1370,7 +1370,7 @@ class DocumentService: ) return db.session.add(dataset_process_rule) - db.session.commit() + db.session.flush() lock_name = f"add_document_lock_dataset_id_{dataset.id}" with redis_client.lock(lock_name, timeout=600): position = DocumentService.get_documents_position(dataset.id)