INNER CODE UNIT · Python
_clear_recon_graph
samugit83/redamon · recon/main.py:1689
def _clear_recon_graph():
"""Wipe this project's previous recon nodes. Runs ONCE per pipeline run.
Domain batch depends on that: the groups accumulate into a single graph, so
clearing per group would leave only the last domain standing.
"""
if not UPDATE_GRAPH_DB:
return
print("[*][graph-db] Clearing previous graph data for this project...")
try:
from graph_db import Neo4jClient
with Neo4jClient() as graph_client:
if graph_client.verify_connection():
clear_stats = graph_client.clear_recon_data(USER_ID, PROJECT_ID)
print(f"[+][graph-db] Previous recon data cleared: {clear_stats['nodes_deleted']} nodes removed\n")
else:
print("[!][graph-db] Could not connect to Neo4j - skipping clear\n")
except Exception as e: