We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1d9d4f3 commit 3e2b152Copy full SHA for 3e2b152
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