Skip to content

Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation

fix: add outgoing checks for scheduler (#3526)

Kartikeya Hegded283053e5eb2
diff --git a/crates/api_models/src/health_check.rs b/crates/api_models/src/health_check.rs
index e4611f43bc..2c65c7b6d5 100644
--- a/crates/api_models/src/health_check.rs
+++ b/crates/api_models/src/health_check.rs
@@ -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 {}
diff --git a/crates/router/src/bin/scheduler.rs b/crates/router/src/bin/scheduler.rs
index 5f98cd8801..59a108ef5e 100644
--- a/crates/router/src/bin/scheduler.rs
+++ b/crates/router/src/bin/scheduler.rs
@@ -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)