fix(db): try to increase the connection timeout to 30s to grab db connections?

This commit is contained in:
perf3ct 2025-07-24 22:32:23 +00:00
parent 10a110d2ec
commit b2a39ee5f3
No known key found for this signature in database
GPG Key ID: 569C4EEC436F5232
1 changed files with 2 additions and 2 deletions

View File

@ -23,7 +23,7 @@ impl Database {
pub async fn new(database_url: &str) -> Result<Self> {
let pool = PgPoolOptions::new()
.max_connections(50) // Increased from 20 to handle more concurrent requests
.acquire_timeout(Duration::from_secs(10)) // Increased from 3 to 10 seconds
.acquire_timeout(Duration::from_secs(30)) // Increased from 10 to 30 seconds
.idle_timeout(Duration::from_secs(600)) // 10 minute idle timeout
.max_lifetime(Duration::from_secs(1800)) // 30 minute max lifetime
.min_connections(5) // Maintain minimum connections
@ -313,4 +313,4 @@ impl Database {
Ok(())
}
}
}