Skip to content

Commit

Permalink
Bugfixes for merged PRs (vercel/turbo#155)
Browse files Browse the repository at this point in the history
  • Loading branch information
sokra committed Oct 21, 2022
1 parent b1caa9e commit d1db10c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ impl Bundler for Turbopack {
proc.stdout
.as_mut()
.ok_or_else(|| anyhow!("missing stdout"))?,
Regex::new("server listening on: (.*)")?,
Regex::new("started server on .+, url: (.*)")?,
)
.ok_or_else(|| anyhow!("failed to find devserver address"))?;

Expand Down
6 changes: 4 additions & 2 deletions packages/next-swc/crates/next-dev/benches/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,13 +212,15 @@ fn bench_hmr_internal(mut g: BenchmarkGroup<WallTime>, location: CodeLocation) {
.await?;

// Make warmup change
for _ in 0..MAX_UPDATE_TIMEOUT.as_secs() / 5 {
for i in (0..MAX_UPDATE_TIMEOUT.as_secs() / 5).rev() {
match make_change(&mut guard, location, Duration::from_secs(5))
.await
{
Ok(_) => break,
Err(err) => {
if err.to_string().contains(CHANGE_TIMEOUT_MESSAGE) {
if i != 0
&& err.to_string().contains(CHANGE_TIMEOUT_MESSAGE)
{
continue;
}
return Err(err);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ use chromiumoxide::{
Browser, Page,
};
use futures::{FutureExt, StreamExt};
use owo_colors::OwoColorize;
use tokio::task::spawn_blocking;
use url::Url;

Expand Down Expand Up @@ -167,6 +166,7 @@ fn stop_process(proc: &mut Child) -> Result<()> {
sys::signal::{kill, Signal},
unistd::Pid,
};
use owo_colors::OwoColorize;

const KILL_DEADLINE: Duration = Duration::from_secs(5);
const KILL_DEADLINE_CHECK_STEPS: u32 = 10;
Expand Down
4 changes: 2 additions & 2 deletions packages/next-swc/crates/next-dev/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ async fn main() -> Result<()> {
format!("http://{}", server.addr)
};
println!(
"{event_type} - started server on {}:{}, url: {}",
event_type = "ready".green(),
"{} - started server on {}:{}, url: {}",
"ready".green(),
server.addr.ip(),
server.addr.port(),
index_uri
Expand Down

0 comments on commit d1db10c

Please sign in to comment.