Fix document lock acquisition for user group sync

This commit is contained in:
Weves
2024-05-08 16:22:44 -07:00
committed by Chris Weaver
parent c631ac0c3a
commit 460e61b3a7

View File

@@ -25,8 +25,7 @@ def _sync_user_group_batch(
logger.debug(f"Syncing document sets for: {document_ids}")
# Acquires a lock on the documents so that no other process can modify them
prepare_to_modify_documents(db_session=db_session, document_ids=document_ids)
with prepare_to_modify_documents(db_session=db_session, document_ids=document_ids):
# get current state of document sets for these documents
document_id_to_access = get_access_for_documents(
document_ids=document_ids, db_session=db_session