MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / cacheNode

Method cacheNode

src/db/queries.ts:899–908  ·  view source on GitHub ↗

* Add a node to the cache, evicting oldest if needed

(node: Node)

Source from the content-addressed store, hash-verified

897 * Add a node to the cache, evicting oldest if needed
898 */
899 private cacheNode(node: Node): void {
900 if (this.nodeCache.size >= this.maxCacheSize) {
901 // Evict oldest (first) entry
902 const firstKey = this.nodeCache.keys().next().value;
903 if (firstKey) {
904 this.nodeCache.delete(firstKey);
905 }
906 }
907 this.nodeCache.set(node.id, node);
908 }
909
910 /**
911 * Clear the node cache

Callers 2

getNodeByIdMethod · 0.95
getNodesByIdsMethod · 0.95

Calls 3

nextMethod · 0.80
deleteMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected