add document lock for multi-thread (#9873)
This commit is contained in:
parent
9633c5dab6
commit
af68084895
1 changed files with 157 additions and 155 deletions
|
|
@ -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 = []
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue