Skip to content
Snippets Groups Projects
Commit 2f75578d authored by James Briggs's avatar James Briggs
Browse files

fix: sync lock release logic

parent 43a7ed17
Branches
Tags
No related merge requests found
......@@ -358,6 +358,11 @@ class BaseIndex(BaseModel):
if self._is_locked(scope=scope) != value:
# in this case, we can set the lock value
break
elif not value:
# if unlocking, we can break immediately — often with Pinecone the
# lock/unlocked state takes a few seconds to update, so locking then
# unlocking quickly will fail without this check
break
if (datetime.now() - start_time).total_seconds() < wait:
# wait for a few seconds before checking again
time.sleep(RETRY_WAIT_TIME)
......
......@@ -662,6 +662,7 @@ class BaseRouter(BaseModel):
:param strategy: The sync strategy to execute.
:type strategy: Dict[str, Dict[str, List[Utterance]]]
"""
print(f"strategy: {strategy}")
if strategy["remote"]["delete"]:
data_to_delete = {} # type: ignore
for utt_obj in strategy["remote"]["delete"]:
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment