mirror of
https://github.com/langgenius/dify.git
synced 2024-11-16 03:32:23 +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),
|
||||
'mode': 'crawl',
|
||||
}
|
||||
if url.length > 255:
|
||||
document_name = url[:200] + '...'
|
||||
else:
|
||||
document_name = url
|
||||
document = DocumentService.build_document(
|
||||
dataset, dataset_process_rule.id,
|
||||
document_data["data_source"]["type"],
|
||||
document_data["doc_form"],
|
||||
document_data["doc_language"],
|
||||
data_source_info, created_from, position,
|
||||
account, url, batch
|
||||
account, document_name, batch
|
||||
)
|
||||
db.session.add(document)
|
||||
db.session.flush()
|
||||
|
|
Loading…
Reference in New Issue
Block a user