fix(watcher.node): Handle fs.watch close without spurious restarts; add tests and improve test runner
This commit is contained in:
@@ -339,8 +339,9 @@ export class NodeWatcher implements IWatcher {
|
||||
|
||||
// Handle 'close' event - fs.watch can close without error
|
||||
watcher.on('close', () => {
|
||||
console.warn(`[smartwatch] FSWatcher closed unexpectedly for ${watchPath}`);
|
||||
// Only log/restart if we didn't intentionally stop
|
||||
if (this._isWatching) {
|
||||
console.warn(`[smartwatch] FSWatcher closed unexpectedly for ${watchPath}`);
|
||||
this.restartWatcher(watchPath, new Error('Watcher closed unexpectedly'));
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user