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

Method cacheNode

src/db/queries.ts:855–864  ·  view source on GitHub ↗

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

(node: Node)

Source from the content-addressed store, hash-verified

853 * Add a node to the cache, evicting oldest if needed
854 */
855 private cacheNode(node: Node): void {
856 if (this.nodeCache.size >= this.maxCacheSize) {
857 // Evict oldest (first) entry
858 const firstKey = this.nodeCache.keys().next().value;
859 if (firstKey) {
860 this.nodeCache.delete(firstKey);
861 }
862 }
863 this.nodeCache.set(node.id, node);
864 }
865
866 /**
867 * Clear the node cache

Callers 2

getNodeByIdMethod · 0.95
getNodesByIdsMethod · 0.95

Calls 1

setMethod · 0.45

Tested by

no test coverage detected