refactor to use default localhost IPs instead of localhost
This commit is contained in:
parent
9ebeeb47f4
commit
c58fdf06b7
4 changed files with 4 additions and 4 deletions
|
@ -131,7 +131,7 @@ impl Health {
|
||||||
async fn ingest_reachable(&self) -> UpDown {
|
async fn ingest_reachable(&self) -> UpDown {
|
||||||
reqwest::get(
|
reqwest::get(
|
||||||
std::env::var("WEBSOCKET_HEALTHCHECK")
|
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
|
.await
|
||||||
.map(|_| UpDown::Up)
|
.map(|_| UpDown::Up)
|
||||||
|
|
|
@ -67,7 +67,7 @@ async fn graphiql() -> impl IntoResponse {
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
async fn main() {
|
async fn main() {
|
||||||
let db_url = std::env::var("DATABASE_URL")
|
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 db = sqlx::PgPool::connect(&db_url).await.unwrap();
|
||||||
|
|
||||||
let schema = Schema::build(query::Query::default(), EmptyMutation, EmptySubscription)
|
let schema = Schema::build(query::Query::default(), EmptyMutation, EmptySubscription)
|
||||||
|
|
|
@ -9,7 +9,7 @@ mod migrations;
|
||||||
lazy_static! {
|
lazy_static! {
|
||||||
pub static ref PG: AsyncOnce<sqlx::PgPool> = AsyncOnce::new(async {
|
pub static ref PG: AsyncOnce<sqlx::PgPool> = AsyncOnce::new(async {
|
||||||
let db_url = std::env::var("DATABASE_URL")
|
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()
|
sqlx::PgPool::connect(&db_url).await.unwrap()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@ lazy_static! {
|
||||||
static ref WS_ADDR: String = env::var("WS_ADDR").unwrap_or_default();
|
static ref WS_ADDR: String = env::var("WS_ADDR").unwrap_or_default();
|
||||||
static ref PG: AsyncOnce<sqlx::PgPool> = AsyncOnce::new(async {
|
static ref PG: AsyncOnce<sqlx::PgPool> = AsyncOnce::new(async {
|
||||||
let db_url = std::env::var("DATABASE_URL")
|
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()
|
PgPoolOptions::new().connect(&db_url).await.unwrap()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue