Skip to content

Commit

Permalink
apparantly stat isn't needed in doScan at all
Browse files Browse the repository at this point in the history
  • Loading branch information
ArjhanToteck committed Mar 10, 2024
1 parent 5b22101 commit 3b12542
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions lib/DirectoryWatcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ class DirectoryWatcher extends EventEmitter {
}
});
for (const itemPath of itemPaths) {
const handleStats = (err2, stats) => {
fs.stat(itemPath, (err2, stats) => {
if (this.closed) return;
if (err2) {
if (
Expand All @@ -653,12 +653,6 @@ class DirectoryWatcher extends EventEmitter {
true,
"scan (file)"
);
if (
this.watcherManager.options.followSymlinks &&
stats.isSymbolicLink()
) {
fs.stat(itemPath, handleStats);
}
} else if (stats.isDirectory()) {
if (!initial || !this.directories.has(itemPath))
this.setDirectory(
Expand All @@ -669,8 +663,7 @@ class DirectoryWatcher extends EventEmitter {
);
}
itemFinished();
};
fs.lstat(itemPath, handleStats);
});
}
itemFinished();
});
Expand Down

0 comments on commit 3b12542

Please sign in to comment.