From b4d1ab938a227ebac53e188814e7d385e6ee7772 Mon Sep 17 00:00:00 2001 From: Oliver Stenbom Date: Mon, 8 Apr 2024 15:02:31 +0200 Subject: [PATCH] Wait 5 seconds for cloudflare tunnel to start (#76) Solves visiting the tunnel too quickly causes ip problems --- Cargo.lock | 2 +- linkup-cli/Cargo.toml | 2 +- linkup-cli/src/background_booting.rs | 2 +- linkup-cli/src/env_files.rs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d90eea7..e10ac4a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1064,7 +1064,7 @@ dependencies = [ [[package]] name = "linkup-cli" -version = "0.2.10" +version = "0.2.11" dependencies = [ "actix-web", "clap", diff --git a/linkup-cli/Cargo.toml b/linkup-cli/Cargo.toml index 0d45254..dee4e40 100644 --- a/linkup-cli/Cargo.toml +++ b/linkup-cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "linkup-cli" -version = "0.2.10" +version = "0.2.11" edition = "2021" [[bin]] diff --git a/linkup-cli/src/background_booting.rs b/linkup-cli/src/background_booting.rs index 3419cd2..db6a756 100644 --- a/linkup-cli/src/background_booting.rs +++ b/linkup-cli/src/background_booting.rs @@ -67,7 +67,7 @@ pub fn boot_background_services() -> Result<(), CliError> { println!("Waiting for tunnel to be ready at {}...", tunnel); // If the tunnel is checked too quickly, it dies ¯\_(ツ)_/¯ - thread::sleep(Duration::from_millis(1000)); + thread::sleep(Duration::from_millis(5000)); wait_till_ok(format!("{}linkup-check", tunnel))?; println!(); diff --git a/linkup-cli/src/env_files.rs b/linkup-cli/src/env_files.rs index 9c5391a..6940e65 100644 --- a/linkup-cli/src/env_files.rs +++ b/linkup-cli/src/env_files.rs @@ -37,7 +37,7 @@ pub fn write_to_env_file(service: &str, dev_env_path: &PathBuf, env_path: &PathB ) })?; - let content = vec![ + let content = [ format!("\n{}", LINKUP_ENV_SEPARATOR), format!("\n{}", dev_env_content), format!("\n{}", LINKUP_ENV_SEPARATOR),