mirror of
https://github.com/hanzoai/fsevents.git
synced 2026-09-24 16:59:25 +00:00
Handle MustScanSubDirs for large projects
When you scan a really large folder for file event changes, the client or kernel might not be able to keep up with all the initial 'add' events sent by fsevents. This happens for me with our humongous vite project that has thousands of files that are sent to firefox. At some point today, chokidar receives undefined as file type when it's actually a rescan request, and fsevents / chokidar attempts to unlink the directory instead of rescanning it, making vite crash after a while instead of finishing processing fsevents. This might be a fix in the correct direction, but the maintainers here are probably better at evaluating it. With this patch locally, vite no longer stops working for large projects on initial load.
This commit is contained in:
@@ -50,6 +50,7 @@ function getInfo(path, flags) {
|
||||
function getFileType(flags) {
|
||||
if (events.ItemIsFile & flags) return "file";
|
||||
if (events.ItemIsDir & flags) return "directory";
|
||||
if (events.MustScanSubDirs & flags) return "directory";
|
||||
if (events.ItemIsSymlink & flags) return "symlink";
|
||||
}
|
||||
function anyIsTrue(obj) {
|
||||
|
||||
Reference in New Issue
Block a user