mirror of
http://112.124.100.131/huang.ze/ebiz-dify-ai.git
synced 2025-12-13 21:06:51 +08:00
add document lock for multi-thread (#9873)
This commit is contained in:
@@ -760,6 +760,8 @@ class DocumentService:
|
|||||||
)
|
)
|
||||||
db.session.add(dataset_process_rule)
|
db.session.add(dataset_process_rule)
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
|
lock_name = "add_document_lock_dataset_id_{}".format(dataset.id)
|
||||||
|
with redis_client.lock(lock_name, timeout=600):
|
||||||
position = DocumentService.get_documents_position(dataset.id)
|
position = DocumentService.get_documents_position(dataset.id)
|
||||||
document_ids = []
|
document_ids = []
|
||||||
duplicate_document_ids = []
|
duplicate_document_ids = []
|
||||||
|
|||||||
Reference in New Issue
Block a user