|
@@ -33,7 +33,7 @@ class BuildGraph(AsyncNeo4jRepository):
|
|
|
acquire_lock = await self.chunk_manager.update_graph_status(
|
|
|
doc_id, chunk_id, self.INIT_STATUS, self.PROCESSING_STATUS
|
|
|
)
|
|
|
- if acquire_lock:
|
|
|
+ if not acquire_lock:
|
|
|
print(f"while building graph, acquire lock for chunk {chunk_id}")
|
|
|
return
|
|
|
|
|
@@ -68,10 +68,12 @@ class BuildGraph(AsyncNeo4jRepository):
|
|
|
async def deal(self, doc_id):
|
|
|
"""async process single chunk"""
|
|
|
chunk_list = await self.get_chunk_list_from_es(doc_id)
|
|
|
- await run_tasks_with_asyncio_task_group(
|
|
|
- task_list=chunk_list,
|
|
|
- handler=self.add_single_chunk,
|
|
|
- description="build graph",
|
|
|
- unit="chunk",
|
|
|
- max_concurrency=10,
|
|
|
- )
|
|
|
+ for chunk in chunk_list:
|
|
|
+ await self.add_single_chunk(chunk)
|
|
|
+ # await run_tasks_with_asyncio_task_group(
|
|
|
+ # task_list=chunk_list,
|
|
|
+ # handler=self.add_single_chunk,
|
|
|
+ # description="build graph",
|
|
|
+ # unit="chunk",
|
|
|
+ # max_concurrency=10,
|
|
|
+ # )
|