diff --git a/Cargo.lock b/Cargo.lock index 191f463..0d19d92 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -195,7 +195,7 @@ checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "healthcheck" -version = "0.1.0" +version = "0.1.1" dependencies = [ "reqwest", "tokio", diff --git a/Cargo.toml b/Cargo.toml index 76e70c6..04b3505 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "healthcheck" -version = "0.1.0" +version = "0.1.1" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/src/main.rs b/src/main.rs index 9af32e9..195ce9a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -17,9 +17,7 @@ async fn main() { let res = client.get(url).send().await; match res { Ok(res) => { - if res.status() < reqwest::StatusCode::OK - || res.status() >= reqwest::StatusCode::MULTIPLE_CHOICES - { + if !res.status().is_success() { exit(1) } exit(0)