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

Method scheduleTreeRefresh

src/sync/watcher.ts:542–553  ·  view source on GitHub ↗

Coalesce directory topology events before walking; file edits never walk the tree.

()

Source from the content-addressed store, hash-verified

540
541 /** Coalesce directory topology events before walking; file edits never walk the tree. */
542 private scheduleTreeRefresh(): void {
543 if (this.treeRefreshTimer || this.inert || this.stopped) return;
544 this.treeRefreshTimer = setTimeout(() => {
545 this.treeRefreshTimer = null;
546 this.refreshWatchTree();
547 if (this.stopped) return;
548 // A new/retargeted directory can already contain files before its watch
549 // is installed; a full reconcile closes that race and removes old paths.
550 this.needsFullScan = true;
551 this.scheduleSync();
552 }, 50);
553 }
554
555 private watchDirectory(dir: string, real: string, recursive: boolean): void {
556 if (this.stopped || (this.degradedReason && !this.recoveringFromLock) || this.inotifyLimitWarned) return;

Callers 3

handleDirEventMethod · 0.95
refreshScopeMethod · 0.95
armGoneCheckMethod · 0.95

Calls 2

refreshWatchTreeMethod · 0.95
scheduleSyncMethod · 0.95

Tested by

no test coverage detected