diff --git a/backend/shared/src/queryable.rs b/backend/shared/src/queryable.rs index 8df9334..cffc48c 100644 --- a/backend/shared/src/queryable.rs +++ b/backend/shared/src/queryable.rs @@ -40,6 +40,7 @@ const BASE_URL_STRING: &str = "https://fosdem.org/2024/schedule/event/"; const MAX_POOL_CONNECTIONS: u32 = 10; const MAX_RELATED_EVENTS: u8 = 5; +const DB_REGION: &str = "eu-central-1"; impl Queryable { pub async fn connect( @@ -52,8 +53,8 @@ impl Queryable { debug!("Connecting to DB"); let db_url = format!( - "postgres://postgres:{}@db.{}.supabase.co/postgres", - db_password, db_id + "postgres://postgres.{}:{}@aws-0-{}.pooler.supabase.com:6543/postgres", + db_id, db_password, DB_REGION ); let pool = PgPoolOptions::new() .max_connections(MAX_POOL_CONNECTIONS) diff --git a/backend/webapp/src/router.rs b/backend/webapp/src/router.rs index d736ba7..0cb46d6 100644 --- a/backend/webapp/src/router.rs +++ b/backend/webapp/src/router.rs @@ -15,7 +15,7 @@ use tower_http::{ cors::{Any, CorsLayer}, services::ServeDir, }; -use tracing::info; +use tracing::{error, info}; use validator::Validate; use crate::related::related; @@ -80,7 +80,10 @@ async fn search( let html = page.render().unwrap(); Ok(Html(html)) } - Err(_) => Err("search failed".into()), + Err(e) => { + error!("search failed: {}", e); + Err("search failed".into()) + } } }