fix: add outgoing checks for scheduler (#3526)

This commit is contained in:
Kartikeya Hegde
2024-02-02 09:49:08 +00:00
committed by GitHub
parent cf0e0b330e
commit d283053e5e
2 changed files with 13 additions and 0 deletions

View File

@ -13,6 +13,7 @@ impl common_utils::events::ApiEventMetric for RouterHealthCheckResponse {}
pub struct SchedulerHealthCheckResponse { pub struct SchedulerHealthCheckResponse {
pub database: bool, pub database: bool,
pub redis: bool, pub redis: bool,
pub outgoing_request: bool,
} }
impl common_utils::events::ApiEventMetric for SchedulerHealthCheckResponse {} impl common_utils::events::ApiEventMetric for SchedulerHealthCheckResponse {}

View File

@ -187,11 +187,23 @@ pub async fn deep_health_check_func(
}) })
})?; })?;
let outgoing_req_check = state
.health_check_outgoing()
.await
.map(|_| true)
.map_err(|err| {
error_stack::report!(errors::ApiErrorResponse::HealthCheckError {
component: "Outgoing Request",
message: err.to_string()
})
})?;
logger::debug!("Redis health check end"); logger::debug!("Redis health check end");
let response = SchedulerHealthCheckResponse { let response = SchedulerHealthCheckResponse {
database: db_status, database: db_status,
redis: redis_status, redis: redis_status,
outgoing_request: outgoing_req_check,
}; };
Ok(response) Ok(response)