mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 17:55:36 +00:00
http_private: add config field db_connections_per_worker
This commit is contained in:
parent
b2a3c034b0
commit
26cd34f10a
2 changed files with 3 additions and 1 deletions
|
|
@ -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(),
|
||||
|
|
|
|||
|
|
@ -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?;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue