Skip to content

Commit

Permalink
refactor(crates/tuono): build - ssg - disable zombie_processes warn…
Browse files Browse the repository at this point in the history
…ing and use `TUONO_PORT` to generate server URL (#199)
  • Loading branch information
marcalexiei authored Dec 6, 2024
1 parent 0839579 commit 1b62d8d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ members = [
]
exclude = [
"apps/documentation",
"examples/wit-mdx",
"examples/with-mdx",
"examples/tuono-app",
"examples/tuono-tutorial",
"benches/tuono"
Expand Down
5 changes: 4 additions & 1 deletion crates/tuono/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ pub fn app() -> std::io::Result<()> {
)
.expect("Failed to clone assets into static output folder");

// the process is killed below so we don't really need to use wait() function
#[allow(clippy::zombie_processes)]
let mut rust_server = app.run_rust_server();

let reqwest = reqwest::blocking::Client::builder()
Expand All @@ -144,7 +146,8 @@ pub fn app() -> std::io::Result<()> {
let mut is_server_ready = false;

while !is_server_ready {
if reqwest.get("http://localhost:3000").send().is_ok() {
let server_url = format!("http://localhost:{}", TUONO_PORT);
if reqwest.get(server_url).send().is_ok() {
is_server_ready = true
}
// TODO: add maximum tries
Expand Down

0 comments on commit 1b62d8d

Please sign in to comment.