mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-31 01:57:45 +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 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 {}
|
||||||
|
|||||||
@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user