http_private: add config field db_connections_per_worker

This commit is contained in:
Joakim Frostegård 2022-04-03 19:20:17 +02:00
parent b2a3c034b0
commit 26cd34f10a
2 changed files with 3 additions and 1 deletions

View file

@ -18,6 +18,7 @@ pub struct Config {
/// generate responses and send them back to the socket workers.
pub request_workers: usize,
pub worker_channel_size: usize,
pub db_connections_per_worker: u32,
pub log_level: LogLevel,
pub network: NetworkConfig,
pub protocol: ProtocolConfig,
@ -31,6 +32,7 @@ impl Default for Config {
socket_workers: 1,
request_workers: 1,
worker_channel_size: 128,
db_connections_per_worker: 1,
log_level: LogLevel::default(),
network: NetworkConfig::default(),
protocol: ProtocolConfig::default(),

View file

@ -53,7 +53,7 @@ async fn run_app(
);
let pool = MySqlPoolOptions::new()
.max_connections(5)
.max_connections(config.db_connections_per_worker)
.connect(&db_url)
.await?;