mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-30 09:38:33 +08:00
fix: add outgoing checks for scheduler (#3526)
This commit is contained in:
@ -13,6 +13,7 @@ impl common_utils::events::ApiEventMetric for RouterHealthCheckResponse {}
|
||||
pub struct SchedulerHealthCheckResponse {
|
||||
pub database: bool,
|
||||
pub redis: bool,
|
||||
pub outgoing_request: bool,
|
||||
}
|
||||
|
||||
impl common_utils::events::ApiEventMetric for SchedulerHealthCheckResponse {}
|
||||
|
||||
@ -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");
|
||||
|
||||
let response = SchedulerHealthCheckResponse {
|
||||
database: db_status,
|
||||
redis: redis_status,
|
||||
outgoing_request: outgoing_req_check,
|
||||
};
|
||||
|
||||
Ok(response)
|
||||
|
||||
Reference in New Issue
Block a user