Rename graphrag task lock (#6576)
### What problem does this PR solve? Rename graphrag task lock ### Type of change - [x] Refactoring
This commit is contained in:
parent
5eabfe3912
commit
c4998d0e09
1 changed files with 5 additions and 3 deletions
|
|
@ -190,7 +190,7 @@ async def merge_subgraph(
|
||||||
embedding_model,
|
embedding_model,
|
||||||
callback,
|
callback,
|
||||||
):
|
):
|
||||||
graphrag_task_lock = RedisDistributedLock("graphrag_task", lock_value=doc_id, timeout=600)
|
graphrag_task_lock = RedisDistributedLock(f"graphrag_task_{kb_id}", lock_value=doc_id, timeout=600)
|
||||||
while True:
|
while True:
|
||||||
if graphrag_task_lock.acquire():
|
if graphrag_task_lock.acquire():
|
||||||
break
|
break
|
||||||
|
|
@ -230,10 +230,11 @@ async def resolve_entities(
|
||||||
embed_bdl,
|
embed_bdl,
|
||||||
callback,
|
callback,
|
||||||
):
|
):
|
||||||
graphrag_task_lock = RedisDistributedLock("graphrag_task", lock_value=doc_id, timeout=600)
|
graphrag_task_lock = RedisDistributedLock(f"graphrag_task_{kb_id}", lock_value=doc_id, timeout=600)
|
||||||
while True:
|
while True:
|
||||||
if graphrag_task_lock.acquire():
|
if graphrag_task_lock.acquire():
|
||||||
break
|
break
|
||||||
|
callback(msg=f"resolve_entities {doc_id} is waiting graphrag_task_lock")
|
||||||
await trio.sleep(10)
|
await trio.sleep(10)
|
||||||
|
|
||||||
start = trio.current_time()
|
start = trio.current_time()
|
||||||
|
|
@ -261,10 +262,11 @@ async def extract_community(
|
||||||
embed_bdl,
|
embed_bdl,
|
||||||
callback,
|
callback,
|
||||||
):
|
):
|
||||||
graphrag_task_lock = RedisDistributedLock("graphrag_task", lock_value=doc_id, timeout=600)
|
graphrag_task_lock = RedisDistributedLock(f"graphrag_task_{kb_id}", lock_value=doc_id, timeout=600)
|
||||||
while True:
|
while True:
|
||||||
if graphrag_task_lock.acquire():
|
if graphrag_task_lock.acquire():
|
||||||
break
|
break
|
||||||
|
callback(msg=f"extract_community {doc_id} is waiting graphrag_task_lock")
|
||||||
await trio.sleep(10)
|
await trio.sleep(10)
|
||||||
|
|
||||||
start = trio.current_time()
|
start = trio.current_time()
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue