-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
feat(core): daemon file watcher #13068
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
Whats this one do? |
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.
Left a few small comments. Overall looks good.
) => void | ||
): Promise<UnregisterCallback> { | ||
await this.sendToDaemonViaQueue({ type: 'PING' }); | ||
let messenger = new SocketMessenger(connect(FULL_OS_SOCKET_PATH)).listen( |
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.
should be a const?
changedFiles.push({ | ||
path: event.path, | ||
type: 'DELETE', | ||
}); | ||
} else { | ||
try { | ||
const s = statSync(join(workspaceRoot, event.path)); | ||
if (!s.isDirectory()) { |
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.
I know it's unrelated but can we change it to s.isFile()
There are other things but directories and files. I think when I wrote this piece I missed it.
async function notifyFileWatcherSockets( | ||
changedFiles: { path: string; type: 'CREATE' | 'UPDATE' | 'DELETE' }[] | ||
) { | ||
for (const { socket } of registeredFileWatcherSockets) { |
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.
Tecnically a faster thing would be to do:
await Promise.all(registeredFileWatcherSockets.map(socket => handleResult(socket...)))
It would then send data to all the sockets in parallel instead of sequentially.
Could you do that?
1d42fb1
to
da99604
Compare
Co-authored-by: Victor Savkin <vsavkin@users.noreply.github.com>
6ffbfaa
to
db34e43
Compare
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |
Co-authored-by: Victor Savkin vsavkin@users.noreply.github.com
Current Behavior
Expected Behavior
Related Issue(s)
Fixes #
usage: