Skip to content

Commit a567e67

Browse files
committed
lock: toml
1 parent 48bd6e8 commit a567e67

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

frameworks/Rust/hyperlane/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ exclude = [
1919

2020
[dependencies]
2121
hyperlane = "=4.59.1"
22+
num_cpus = "=1.16.0"
2223
rand = "=0.9.0"
2324
serde = "=1.0.219"
2425
sqlx = { version = "=0.8.3", features = ["runtime-tokio", "postgres"] }

frameworks/Rust/hyperlane/src/db.rs

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -100,18 +100,10 @@ pub async fn connection_db() -> DbPoolConnection {
100100
DATABASE_NAME
101101
),
102102
};
103-
let pool_size: u32 = (get_thread_count() << 2).max(10).min(100) as u32;
104-
let max_pool_size: u32 = option_env!("POSTGRES_MAX_POOL_SIZE")
105-
.unwrap_or(&pool_size.to_string())
106-
.parse::<u32>()
107-
.unwrap_or(pool_size);
108-
let min_pool_size: u32 = option_env!("POSTGRES_MIN_POOL_SIZE")
109-
.unwrap_or(&pool_size.to_string())
110-
.parse::<u32>()
111-
.unwrap_or(pool_size);
103+
let pool_size: u32 = num_cpus::get() as u32;
112104
let pool: DbPoolConnection = PgPoolOptions::new()
113-
.max_connections(max_pool_size)
114-
.min_connections(min_pool_size)
105+
.max_connections(100)
106+
.min_connections(pool_size)
115107
.max_lifetime(None)
116108
.test_before_acquire(false)
117109
.idle_timeout(None)

0 commit comments

Comments
 (0)