Skip to content

Commit

Permalink
renamed max_attempts to max_db_attempts
Browse files Browse the repository at this point in the history
  • Loading branch information
enola-dkfz committed Oct 14, 2024
1 parent 60f42e3 commit c976254
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub struct SqlQuery {

include!(concat!(env!("OUT_DIR"), "/sql_replace_map.rs"));

pub async fn get_pg_connection_pool(pg_url: &str, max_attempts: u32) -> Result<PgPool, FocusError> {
pub async fn get_pg_connection_pool(pg_url: &str, max_db_attempts: u32) -> Result<PgPool, FocusError> {
info!("Trying to establish a PostgreSQL connection pool");

tryhard::retry_fn(|| async {
Expand All @@ -28,7 +28,7 @@ pub async fn get_pg_connection_pool(pg_url: &str, max_attempts: u32) -> Result<P
FocusError::CannotConnectToDatabase(e.to_string())
})
})
.retries(max_attempts)
.retries(max_db_attempts)
.exponential_backoff(Duration::from_secs(2))
.await
}
Expand Down

0 comments on commit c976254

Please sign in to comment.