Coalesce directory topology events before walking; file edits never walk the tree.
()
| 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; |
no test coverage detected