Add parameter for db pool size
This commit is contained in:
parent
9a87e502f7
commit
11e1a51a2a
2 changed files with 3 additions and 1 deletions
BIN
Cargo.lock
generated
BIN
Cargo.lock
generated
Binary file not shown.
|
@ -27,7 +27,8 @@ async fn main() -> Result<(), std::io::Error> {
|
||||||
|
|
||||||
init_logging(&settings.logging.level)?;
|
init_logging(&settings.logging.level)?;
|
||||||
|
|
||||||
let pool = emgauwa_common::db::init(&settings.database).await?;
|
let pool_size = 10;
|
||||||
|
let pool = emgauwa_common::db::init(&settings.database, pool_size).await?;
|
||||||
|
|
||||||
let mut conn = pool.acquire().await.map_err(EmgauwaError::from)?;
|
let mut conn = pool.acquire().await.map_err(EmgauwaError::from)?;
|
||||||
DbController::all_inactive(&mut conn)
|
DbController::all_inactive(&mut conn)
|
||||||
|
@ -112,6 +113,7 @@ async fn main() -> Result<(), std::io::Error> {
|
||||||
.service(handlers::v1::ws::ws_relays),
|
.service(handlers::v1::ws::ws_relays),
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
.workers((pool_size / 2) as usize)
|
||||||
.listen(listener)?
|
.listen(listener)?
|
||||||
.run()
|
.run()
|
||||||
.await
|
.await
|
||||||
|
|
Loading…
Reference in a new issue