Skip to content

Commit 4d71e13

Browse files
committed
Automatically recompile content graph after saving changes in Content Manager
1 parent cc02552 commit 4d71e13

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

modules/contentManager/data_io.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,16 @@ def save_all(self):
152152
self._save_json("refinements.json", new_refinements)
153153
self._save_json("stats.json", self.unified_data["stats"])
154154

155+
# Automatically recompile the content graph
156+
print("Recompiling content graph...")
157+
migrate_script = os.path.join(PROJECT_ROOT, "scripts", "migrate_to_graph.py")
158+
import subprocess
159+
try:
160+
subprocess.run(["python", migrate_script], check=True, cwd=PROJECT_ROOT)
161+
print("Content graph recompiled successfully.")
162+
except Exception as e:
163+
print(f"Error recompiling content graph: {e}")
164+
155165
def _save_json(self, filename, data):
156166
path = os.path.join(self.data_dir, filename)
157167
with open(path, 'w', encoding='utf-8') as f:

0 commit comments

Comments
 (0)