Remove graph overwriting on exception in NetworkXAdapter
This commit is contained in:
parent
f097fcfd3b
commit
058b5916a4
1 changed files with 0 additions and 8 deletions
|
|
@ -267,14 +267,6 @@ class NetworkXAdapter(GraphDBInterface):
|
||||||
await self.save_graph_to_file(file_path)
|
await self.save_graph_to_file(file_path)
|
||||||
except Exception:
|
except Exception:
|
||||||
logger.error("Failed to load graph from file: %s", file_path)
|
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):
|
async def delete_graph(self, file_path: str = None):
|
||||||
"""Asynchronously delete the graph file from the filesystem."""
|
"""Asynchronously delete the graph file from the filesystem."""
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue