refactor(crates/tuono): build - ssg - disable zombie_processes warning and use TUONO_PORT to generate server URL (#199)

This commit is contained in:
Marco Pasqualetti
2024-12-06 13:05:24 +01:00
committed by GitHub
parent 0839579733
commit 1b62d8ddc2
2 changed files with 5 additions and 2 deletions
+1 -1
View File
@@ -7,7 +7,7 @@ members = [
]
exclude = [
"apps/documentation",
"examples/wit-mdx",
"examples/with-mdx",
"examples/tuono-app",
"examples/tuono-tutorial",
"benches/tuono"
+4 -1
View File
@@ -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()
@@ -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