- update: health check status output to health log

This commit is contained in:
2024-12-17 20:03:12 -05:00
parent ee29fef634
commit aaa7143b11
2 changed files with 4 additions and 2 deletions

View File

@@ -23,7 +23,7 @@ use tracing::{debug, error, info, warn};
use utils::service_discovery;
pub(crate) async fn handle_accept_req(stream: &mut TcpStream, packet: Packet) -> Result<(), Box<dyn Error + Send + Sync>> {
let request = CliAcceptReq::decode(packet.payload.as_slice());
// let request = CliAcceptReq::decode(packet.payload.as_slice());
// We need to do reply to this packet
let data = SrvAcceptReply { result: srv_accept_reply::Result::Accepted, rand_value: 0 };

View File

@@ -86,8 +86,10 @@ pub async fn start_health_check(service_address: &str) -> Result<(), Box<dyn std
let health_check_endpoint_addr = format!("{}:{}", service_address, health_port);
// Start health-check endpoint
let log = warp::log("health_check");
let health_route = warp::path!("health")
.map(|| warp::reply::with_status("OK", warp::http::StatusCode::OK));
.map(|| warp::reply::with_status("OK", warp::http::StatusCode::OK))
.with(log);
tokio::spawn(warp::serve(health_route).run(health_check_endpoint_addr.to_socket_addrs()?.next().unwrap()));