MCPcopy Index your code
hub / github.com/forloopcodes/contextplus / scheduleSave

Function scheduleSave

src/core/memory-graph.ts:106–115  ·  view source on GitHub ↗
(rootDir: string)

Source from the content-addressed store, hash-verified

104}
105
106function scheduleSave(rootDir: string): void {
107 const existing = saveTimeout.get(rootDir);
108 if (existing) clearTimeout(existing);
109 savePending.set(rootDir, true);
110 saveTimeout.set(rootDir, setTimeout(() => {
111 if (savePending.get(rootDir)) {
112 persistGraph(rootDir).catch(() => {}).finally(() => savePending.set(rootDir, false));
113 }
114 }, 500));
115}
116
117function getEdgesForNode(graph: GraphStore, nodeId: string): MemoryEdge[] {
118 return Object.values(graph.edges).filter(e => e.source === nodeId || e.target === nodeId);

Callers 5

upsertNodeFunction · 0.85
createRelationFunction · 0.85
searchGraphFunction · 0.85
pruneStaleLinksFunction · 0.85
retrieveWithTraversalFunction · 0.85

Calls 1

persistGraphFunction · 0.85

Tested by

no test coverage detected