diff --git a/src/application.rs b/src/application.rs index 3e51877d..fe71808c 100644 --- a/src/application.rs +++ b/src/application.rs @@ -338,6 +338,8 @@ async fn get_connection_pool(setting: &DatabaseSetting) -> Result PgPoolOptions::new() .max_connections(setting.max_connections) .acquire_timeout(Duration::from_secs(10)) + .max_lifetime(Duration::from_secs(60 * 60)) + .idle_timeout(Duration::from_secs(60)) .connect_with(setting.with_db()) .await .map_err(|e| anyhow::anyhow!("Failed to connect to postgres database: {}", e))