You've already forked AstralRinth
forked from didirus/AstralRinth
Final V2 Changes (#212)
* Redo dependencies, add rejection reasons, make notifications more readable * Fix errors, add dependency route, finish PR * Fix clippy errors
This commit is contained in:
@@ -11,7 +11,20 @@ pub async fn connect() -> Result<PgPool, sqlx::Error> {
|
||||
|
||||
let database_url = dotenv::var("DATABASE_URL").expect("`DATABASE_URL` not in .env");
|
||||
let pool = PgPoolOptions::new()
|
||||
.max_connections(20)
|
||||
.min_connections(
|
||||
dotenv::var("DATABASE_MIN_CONNECTIONS")
|
||||
.ok()
|
||||
.map(|x| x.parse::<u32>().ok())
|
||||
.flatten()
|
||||
.unwrap_or(16),
|
||||
)
|
||||
.max_connections(
|
||||
dotenv::var("DATABASE_MAX_CONNECTIONS")
|
||||
.ok()
|
||||
.map(|x| x.parse::<u32>().ok())
|
||||
.flatten()
|
||||
.unwrap_or(16),
|
||||
)
|
||||
.connect(&database_url)
|
||||
.await?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user