- removed: api-service
- removed: session-service - updated: moved health check out of consul registration - updated: get service info to pull the service from the default namespace for the service account - updated: the rest of the services to be able to handle the new database tables
This commit is contained in:
@@ -3,10 +3,8 @@ use serde_json::json;
|
||||
use std::collections::HashMap;
|
||||
use std::env;
|
||||
use std::fs;
|
||||
use std::net::ToSocketAddrs;
|
||||
use std::path::Path;
|
||||
use uuid::Uuid;
|
||||
use warp::Filter;
|
||||
|
||||
const VERSION: &'static str = env!("CARGO_PKG_VERSION");
|
||||
|
||||
@@ -106,25 +104,3 @@ pub async fn deregister_service(
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub async fn start_health_check(service_address: &str) -> Result<(), Box<dyn std::error::Error>> {
|
||||
let health_port = env::var("HEALTH_CHECK_PORT").unwrap_or_else(|_| "8082".to_string());
|
||||
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))
|
||||
.with(log);
|
||||
|
||||
tokio::spawn(
|
||||
warp::serve(health_route).run(
|
||||
health_check_endpoint_addr
|
||||
.to_socket_addrs()?
|
||||
.next()
|
||||
.unwrap(),
|
||||
),
|
||||
);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user