mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-14 04:25:59 +08:00
fix web import url is too long (#6402)
This commit is contained in:
parent
8a80af39c9
commit
f55876bcc5
@ -845,13 +845,17 @@ class DocumentService:
|
|||||||
'only_main_content': website_info.get('only_main_content', False),
|
'only_main_content': website_info.get('only_main_content', False),
|
||||||
'mode': 'crawl',
|
'mode': 'crawl',
|
||||||
}
|
}
|
||||||
|
if url.length > 255:
|
||||||
|
document_name = url[:200] + '...'
|
||||||
|
else:
|
||||||
|
document_name = url
|
||||||
document = DocumentService.build_document(
|
document = DocumentService.build_document(
|
||||||
dataset, dataset_process_rule.id,
|
dataset, dataset_process_rule.id,
|
||||||
document_data["data_source"]["type"],
|
document_data["data_source"]["type"],
|
||||||
document_data["doc_form"],
|
document_data["doc_form"],
|
||||||
document_data["doc_language"],
|
document_data["doc_language"],
|
||||||
data_source_info, created_from, position,
|
data_source_info, created_from, position,
|
||||||
account, url, batch
|
account, document_name, batch
|
||||||
)
|
)
|
||||||
db.session.add(document)
|
db.session.add(document)
|
||||||
db.session.flush()
|
db.session.flush()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user