We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
http_health_check
2 parents 1d9d4f3 + 3e2b152 commit b001ffdCopy full SHA for b001ffd
src/bin/http_health_check.rs
@@ -4,8 +4,11 @@
4
//!
5
//! - They are harder to maintain.
6
//! - They introduce new attack vectors.
7
+use std::time::Duration;
8
use std::{env, process};
9
10
+use reqwest::Client;
11
+
12
#[tokio::main]
13
async fn main() {
14
let args: Vec<String> = env::args().collect();
@@ -19,7 +22,9 @@ async fn main() {
19
22
20
23
let url = &args[1].clone();
21
24
- match reqwest::get(url).await {
25
+ let client = Client::builder().timeout(Duration::from_secs(5)).build().unwrap();
26
27
+ match client.get(url).send().await {
28
Ok(response) => {
29
if response.status().is_success() {
30
println!("STATUS: {}", response.status());
0 commit comments