Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
82934fc8
Unverified
Commit
82934fc8
authored
Jul 23, 2026
by
Benjamin Woodruff
Committed by
GitHub
Jul 23, 2026
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Turbopack: Very minor improvements for watcher loop (#96103)
Noticed these things while reading through the code.
parent
00c9e3aa
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
watcher.rs
turbopack/crates/turbo-tasks-fs/src/watcher.rs
+5
-2
No files found.
turbopack/crates/turbo-tasks-fs/src/watcher.rs
View file @
82934fc8
...
@@ -508,6 +508,10 @@ impl DiskWatcher {
...
@@ -508,6 +508,10 @@ impl DiskWatcher {
if
event
.need_rescan
()
{
if
event
.need_rescan
()
{
let
_lock
=
fs_inner
.invalidation_lock
.blocking_write
();
let
_lock
=
fs_inner
.invalidation_lock
.blocking_write
();
// flush the whole mpsc queue, we're about to rescan, we don't need to
// process any other update events that have already happened
while
rx
.try_recv
()
.is_ok
()
{}
if
let
State
::
NonRecursive
(
non_recursive
)
=
&
self
.state
{
if
let
State
::
NonRecursive
(
non_recursive
)
=
&
self
.state
{
// we can't narrow this down to a smaller set of paths: Rescan
// we can't narrow this down to a smaller set of paths: Rescan
// events (at least when tested on
// events (at least when tested on
...
@@ -746,7 +750,7 @@ impl BatchedInvalidations {
...
@@ -746,7 +750,7 @@ impl BatchedInvalidations {
EventKind
::
Modify
(
ModifyKind
::
Name
(
RenameMode
::
Both
))
=>
{
EventKind
::
Modify
(
ModifyKind
::
Name
(
RenameMode
::
Both
))
=>
{
// For the rename::both, notify provides an array of paths
// For the rename::both, notify provides an array of paths
// in given order
// in given order
if
let
[
source
,
destination
,
..
]
=
&
paths
[
..
]
{
if
let
[
source
,
destination
]
=
&
paths
[
..
]
{
self
.path_and_children
.insert
(
source
.clone
());
self
.path_and_children
.insert
(
source
.clone
());
if
let
Some
(
parent
)
=
source
.parent
()
{
if
let
Some
(
parent
)
=
source
.parent
()
{
self
.path_dir
.insert
(
PathBuf
::
from
(
parent
));
self
.path_dir
.insert
(
PathBuf
::
from
(
parent
));
...
@@ -767,7 +771,6 @@ impl BatchedInvalidations {
...
@@ -767,7 +771,6 @@ impl BatchedInvalidations {
// but we also check other RenameModes to cover cases where notify couldn't match the
// but we also check other RenameModes to cover cases where notify couldn't match the
// two rename events.
// two rename events.
EventKind
::
Any
|
EventKind
::
Modify
(
ModifyKind
::
Any
|
ModifyKind
::
Name
(
..
))
=>
{
EventKind
::
Any
|
EventKind
::
Modify
(
ModifyKind
::
Any
|
ModifyKind
::
Name
(
..
))
=>
{
self
.path
.extend
(
paths
.clone
());
self
.path_and_children
.extend
(
paths
.clone
());
self
.path_and_children
.extend
(
paths
.clone
());
self
.path_and_children_dir
.extend
(
paths
.clone
());
self
.path_and_children_dir
.extend
(
paths
.clone
());
for
path
in
&
paths
{
for
path
in
&
paths
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment