diff --git a/src/db.rs b/src/db.rs index d11b2bd..6bc8831 100644 --- a/src/db.rs +++ b/src/db.rs @@ -4,7 +4,7 @@ use sqlx::{postgres::PgPoolOptions, PgPool}; pub async fn get_pg_pool() -> PgPool { let database_url: String = format!( - "postgresql://{}:{}@{}:{}/{}?connection_limit=10&pool_timeout=300", + "postgresql://{}:{}@{}:{}/{}", CONFIG.postgres_user, CONFIG.postgres_password, CONFIG.postgres_host, @@ -13,7 +13,8 @@ pub async fn get_pg_pool() -> PgPool { ); PgPoolOptions::new() - .max_connections(5) + .max_connections(10) + .acquire_timeout(std::time::Duration::from_secs(300)) .connect(&database_url) .await .unwrap()