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
9808d727
Unverified
Commit
9808d727
authored
Sep 04, 2024
by
Tobias Koppers
Committed by
GitHub
Sep 04, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix trace file reloading (#69655)
### What? reloads the trace file when it is re-created.
parent
52cc01df
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
14 deletions
+12
-14
mod.rs
turbopack/crates/turbopack-trace-server/src/reader/mod.rs
+12
-14
No files found.
turbopack/crates/turbopack-trace-server/src/reader/mod.rs
View file @
9808d727
...
@@ -252,25 +252,23 @@ impl TraceReader {
...
@@ -252,25 +252,23 @@ impl TraceReader {
println!
(
"Initial read completed ({} MB)"
,
total
/
(
1024
*
1024
));
println!
(
"Initial read completed ({} MB)"
,
total
/
(
1024
*
1024
));
}
}
}
}
thread
::
sleep
(
Duration
::
from_millis
(
100
));
loop
{
let
Ok
(
end
)
=
file
.seek
(
SeekFrom
::
End
(
0
))
else
{
// No more data to read, sleep for a while to wait for more data
return
Some
(
true
);
thread
::
sleep
(
Duration
::
from_millis
(
100
));
};
let
Ok
(
mut
real_file
)
=
File
::
open
(
&
self
.path
)
else
{
// No more data to read, sleep for a while to wait for more data
if
end
<
pos
{
// new file
return
Some
(
true
);
}
else
if
end
!=
pos
{
// Seek to the same position. This will fail when the file was
// truncated.
let
Ok
(
new_pos
)
=
file
.seek
(
SeekFrom
::
Start
(
pos
))
else
{
return
Some
(
true
);
return
Some
(
true
);
};
};
if
new_pos
!=
pos
{
let
Ok
(
end
)
=
real_file
.seek
(
SeekFrom
::
End
(
0
))
else
{
return
Some
(
true
);
};
if
end
<
pos
{
// new file
return
Some
(
true
);
return
Some
(
true
);
}
else
if
end
!=
pos
{
// file has more data
return
None
;
}
}
}
}
None
}
}
fn
wait_for_new_file
(
&
self
,
file
:
&
mut
TraceFile
)
{
fn
wait_for_new_file
(
&
self
,
file
:
&
mut
TraceFile
)
{
...
...
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