From c58fdf06b79dbe0ba6cee395deed7d7826b82904 Mon Sep 17 00:00:00 2001 From: Noelle Calliope <1581674+mekanoe@users.noreply.github.com> Date: Mon, 4 Sep 2023 01:30:23 -0400 Subject: [PATCH] refactor to use default localhost IPs instead of localhost --- services/api/src/health.rs | 2 +- services/api/src/main.rs | 2 +- services/tasks/src/main.rs | 2 +- services/websocket/src/main.rs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/services/api/src/health.rs b/services/api/src/health.rs index 5f30492..8c43116 100644 --- a/services/api/src/health.rs +++ b/services/api/src/health.rs @@ -131,7 +131,7 @@ impl Health { async fn ingest_reachable(&self) -> UpDown { reqwest::get( std::env::var("WEBSOCKET_HEALTHCHECK") - .unwrap_or("http://localhost:8999/health".to_string()), + .unwrap_or("http://127.0.0.1:8999/healthz".to_string()), ) .await .map(|_| UpDown::Up) diff --git a/services/api/src/main.rs b/services/api/src/main.rs index 414b6fb..7c1aafa 100644 --- a/services/api/src/main.rs +++ b/services/api/src/main.rs @@ -67,7 +67,7 @@ async fn graphiql() -> impl IntoResponse { #[tokio::main] async fn main() { let db_url = std::env::var("DATABASE_URL") - .unwrap_or("postgres://saerrouser:saerro321@localhost:5432/data".to_string()); + .unwrap_or("postgres://saerrouser:saerro321@127.0.0.1:5432/data".to_string()); let db = sqlx::PgPool::connect(&db_url).await.unwrap(); let schema = Schema::build(query::Query::default(), EmptyMutation, EmptySubscription) diff --git a/services/tasks/src/main.rs b/services/tasks/src/main.rs index 420fc4f..01d2f4e 100644 --- a/services/tasks/src/main.rs +++ b/services/tasks/src/main.rs @@ -9,7 +9,7 @@ mod migrations; lazy_static! { pub static ref PG: AsyncOnce = AsyncOnce::new(async { let db_url = std::env::var("DATABASE_URL") - .unwrap_or("postgres://saerrouser:saerro321@localhost:5432/data".to_string()); + .unwrap_or("postgres://saerrouser:saerro321@127.0.0.1:5432/data".to_string()); sqlx::PgPool::connect(&db_url).await.unwrap() }); } diff --git a/services/websocket/src/main.rs b/services/websocket/src/main.rs index af8c413..8047d28 100644 --- a/services/websocket/src/main.rs +++ b/services/websocket/src/main.rs @@ -17,7 +17,7 @@ lazy_static! { static ref WS_ADDR: String = env::var("WS_ADDR").unwrap_or_default(); static ref PG: AsyncOnce = AsyncOnce::new(async { let db_url = std::env::var("DATABASE_URL") - .unwrap_or("postgres://saerrouser:saerro321@localhost:5432/data".to_string()); + .unwrap_or("postgres://saerrouser:saerro321@127.0.0.1:5432/data".to_string()); PgPoolOptions::new().connect(&db_url).await.unwrap() }); }