feat: add initial churn

Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
2023-08-25 21:52:28 +02:00
parent f61d0bbf12
commit 97978df287
7 changed files with 258 additions and 21 deletions

View File

@@ -11,3 +11,4 @@ tracing-subscriber.workspace = true
clap.workspace = true
dotenv.workspace = true
axum.workspace = true
reqwest.workspace = true

View File

@@ -51,9 +51,11 @@ async fn handle_command(cmd: Command) -> anyhow::Result<()> {
} => todo!(),
Commands::Health { server, agent } => {
tracing::info!("connecting to server: {}", server);
tokio::time::sleep(std::time::Duration::from_secs(5)).await;
reqwest::get(format!("{server}/ping")).await?;
tracing::info!("connected to server successfully");
tracing::info!("connecting to agent: {}", agent);
tokio::time::sleep(std::time::Duration::from_secs(5)).await;
reqwest::get(format!("{agent}/ping")).await?;
tracing::info!("connected to agent successfully");
Ok(())
}
}