Merge branch 'main' into build/feat/hitl

This commit is contained in:
yyh
2026-02-08 01:30:01 +08:00
committed by GitHub
2 changed files with 10 additions and 5 deletions

View File

@@ -1696,13 +1696,18 @@ class DocumentService:
for document in documents
if document.data_source_type == "upload_file" and document.data_source_info_dict
]
if dataset.doc_form is not None:
batch_clean_document_task.delay(document_ids, dataset.id, dataset.doc_form, file_ids)
# Delete documents first, then dispatch cleanup task after commit
# to avoid deadlock between main transaction and async task
for document in documents:
db.session.delete(document)
db.session.commit()
# Dispatch cleanup task after commit to avoid lock contention
# Task cleans up segments, files, and vector indexes
if dataset.doc_form is not None:
batch_clean_document_task.delay(document_ids, dataset.id, dataset.doc_form, file_ids)
@staticmethod
def rename_document(dataset_id: str, document_id: str, name: str) -> Document:
assert isinstance(current_user, Account)

View File

@@ -194,11 +194,11 @@ const ConfigContent: FC<Props> = ({
</div>
{type === RETRIEVE_TYPE.multiWay && (
<>
<div className="my-2 flex h-6 items-center py-1">
<div className="system-xs-semibold-uppercase mr-2 shrink-0 text-text-secondary">
<div className="my-2 flex flex-col items-center py-1">
<div className="system-xs-semibold-uppercase mb-2 mr-2 shrink-0 text-text-secondary">
{t('rerankSettings', { ns: 'dataset' })}
</div>
<Divider bgStyle="gradient" className="mx-0 !h-px" />
<Divider bgStyle="gradient" className="m-0 !h-px" />
</div>
{
selectedDatasetsMode.inconsistentEmbeddingModel