Skip to content

Commit

Permalink
Increase the maximum amount of time to spend waiting for a connection…
Browse files Browse the repository at this point in the history
… to 30s
  • Loading branch information
ssantos21 committed May 21, 2024
1 parent 15659f0 commit 373ca81
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion server/src/server.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use std::time::Duration;

use sqlx::{Pool, Postgres, postgres::PgPoolOptions};

use crate::server_config::ServerConfig;
Expand All @@ -14,7 +16,8 @@ impl StateChainEntity {

let pool =
PgPoolOptions::new()
// .max_connections(5)
.max_connections(10)
.acquire_timeout(Duration::from_secs(30)) // Increase the timeout duration
.connect(&config.connection_string)
.await
.unwrap();
Expand Down

0 comments on commit 373ca81

Please sign in to comment.