Remove graph overwriting on exception in NetworkXAdapter

This commit is contained in:
Leon Luithlen 2024-11-11 12:59:36 +01:00
parent f097fcfd3b
commit 058b5916a4

View file

@ -267,14 +267,6 @@ class NetworkXAdapter(GraphDBInterface):
await self.save_graph_to_file(file_path)
except Exception:
logger.error("Failed to load graph from file: %s", file_path)
# Initialize an empty graph in case of error
self.graph = nx.MultiDiGraph()
file_dir = os.path.dirname(file_path)
if not os.path.exists(file_dir):
os.makedirs(file_dir, exist_ok = True)
await self.save_graph_to_file(file_path)
async def delete_graph(self, file_path: str = None):
"""Asynchronously delete the graph file from the filesystem."""