diff --git a/apps/api/libs/query_engine/src/data_source_connections/get_redshift_connection.rs b/apps/api/libs/query_engine/src/data_source_connections/get_redshift_connection.rs index 3ce2d5e8a..9b2828a7a 100644 --- a/apps/api/libs/query_engine/src/data_source_connections/get_redshift_connection.rs +++ b/apps/api/libs/query_engine/src/data_source_connections/get_redshift_connection.rs @@ -16,19 +16,20 @@ pub async fn get_redshift_connection(credentials: &RedshiftCredentials) -> Resul .password(credentials.password.as_str()) .database(&credentials.default_database) .extra_float_digits(2) - .connect_timeout(Duration::from_secs(60)); // 60 second connection timeout + .options([("connect_timeout", "120")]); // 120 second connection timeout let redshift_pool = match PgPoolOptions::new() .max_connections(1) - .acquire_timeout(Duration::from_secs(60)) // 60 second acquire timeout - .connect_timeout(Duration::from_secs(60)) // 60 second pool connection timeout + .acquire_timeout(Duration::from_secs(120)) // 120 second acquire timeout + .idle_timeout(Duration::from_secs(600)) // 10 minute idle timeout + .max_lifetime(Duration::from_secs(3600)) // 1 hour max lifetime .connect_with(options) .await { Ok(redshift_pool) => redshift_pool, Err(e) => { tracing::error!("There was an issue while connecting to Redshift: {}", e); - return Err(anyhow!(e)); + return Err(anyhow!("Failed to connect to Redshift: {}", e)); } };