MCPcopy
hub / github.com/colbymchenry/codegraph / cacheNode

Method cacheNode

src/db/queries.ts:512–521  ·  view source on GitHub ↗

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

(node: Node)

Source from the content-addressed store, hash-verified

510 * Add a node to the cache, evicting oldest if needed
511 */
512 private cacheNode(node: Node): void {
513 if (this.nodeCache.size >= this.maxCacheSize) {
514 // Evict oldest (first) entry
515 const firstKey = this.nodeCache.keys().next().value;
516 if (firstKey) {
517 this.nodeCache.delete(firstKey);
518 }
519 }
520 this.nodeCache.set(node.id, node);
521 }
522
523 /**
524 * Clear the node cache

Callers 2

getNodeByIdMethod · 0.95
getNodesByIdsMethod · 0.95

Calls 1

setMethod · 0.80

Tested by

no test coverage detected