-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make vite-plugin-content-virtual-mod run getEntrySlug
10 at a time
#7125
Conversation
🦋 Changeset detectedLatest commit: 3d09c0c The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks good. Should we make a preview release and ask users to test it to make sure that this is the correct fix?
!preview content-serial |
|
!preview content-serial |
|
getEntrySlug
seriallygetEntrySlug
10 at a time
I wonder if the issue isn't the watcher at all... since the error says "too many open files", maybe we should use try to use |
I think the nodejs APIs we use to read files doesn't get the file handle, so it's automatically closed by default. But it can definitely be the watcher still causing issues. Maybe we could share the same Vite server's watcher for type generation? Could be that we have two watchers that's causing the problem 🤔 I'll go ahead and merge this first to unblock some users' setups. |
Changes
Fix #7073
Make vite-plugin-content-virtual-mod run
getEntrySlug
serially as it reads the filesystem. Running in parallel all at once could cause the OS to lock reading files.Testing
Manually tested with docs to see if there's a first-page load slowdown. I didn't notice a big difference so this should be good.
Docs
n/a. bug fix.