Remove duplicated graph db lock
This commit is contained in:
parent
b8a2d5b223
commit
ebcabe29ca
1 changed files with 12 additions and 18 deletions
|
|
@ -1901,15 +1901,12 @@ Rebuilt: {len(entities_to_rebuild)} entities, {len(relationships_to_rebuild)} re
|
||||||
"""
|
"""
|
||||||
from .utils_graph import adelete_by_entity
|
from .utils_graph import adelete_by_entity
|
||||||
|
|
||||||
# Use graph database lock to ensure atomic merges and updates
|
return await adelete_by_entity(
|
||||||
graph_db_lock = get_graph_db_lock(enable_logging=False)
|
self.chunk_entity_relation_graph,
|
||||||
async with graph_db_lock:
|
self.entities_vdb,
|
||||||
return await adelete_by_entity(
|
self.relationships_vdb,
|
||||||
self.chunk_entity_relation_graph,
|
entity_name,
|
||||||
self.entities_vdb,
|
)
|
||||||
self.relationships_vdb,
|
|
||||||
entity_name,
|
|
||||||
)
|
|
||||||
|
|
||||||
def delete_by_entity(self, entity_name: str) -> None:
|
def delete_by_entity(self, entity_name: str) -> None:
|
||||||
loop = always_get_an_event_loop()
|
loop = always_get_an_event_loop()
|
||||||
|
|
@ -1924,15 +1921,12 @@ Rebuilt: {len(entities_to_rebuild)} entities, {len(relationships_to_rebuild)} re
|
||||||
"""
|
"""
|
||||||
from .utils_graph import adelete_by_relation
|
from .utils_graph import adelete_by_relation
|
||||||
|
|
||||||
# Use graph database lock to ensure atomic merges and updates
|
return await adelete_by_relation(
|
||||||
graph_db_lock = get_graph_db_lock(enable_logging=False)
|
self.chunk_entity_relation_graph,
|
||||||
async with graph_db_lock:
|
self.relationships_vdb,
|
||||||
return await adelete_by_relation(
|
source_entity,
|
||||||
self.chunk_entity_relation_graph,
|
target_entity,
|
||||||
self.relationships_vdb,
|
)
|
||||||
source_entity,
|
|
||||||
target_entity,
|
|
||||||
)
|
|
||||||
|
|
||||||
def delete_by_relation(self, source_entity: str, target_entity: str) -> None:
|
def delete_by_relation(self, source_entity: str, target_entity: str) -> None:
|
||||||
loop = always_get_an_event_loop()
|
loop = always_get_an_event_loop()
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue