mirror of
https://github.com/danbulant/Portfolio
synced 2026-07-08 12:30:56 +00:00
Merge pull request #213 from EETagent/improve_connection_pool_settings
(backend) improve connection pool config
This commit is contained in:
commit
75988d427d
1 changed files with 15 additions and 12 deletions
|
|
@ -1,5 +1,5 @@
|
||||||
use portfolio_core::{sea_orm::{self}};
|
|
||||||
use async_trait::async_trait;
|
use async_trait::async_trait;
|
||||||
|
use portfolio_core::sea_orm::{self};
|
||||||
#[cfg(not(test))]
|
#[cfg(not(test))]
|
||||||
use sea_orm::ConnectOptions;
|
use sea_orm::ConnectOptions;
|
||||||
use sea_orm_rocket::{rocket::figment::Figment, Database};
|
use sea_orm_rocket::{rocket::figment::Figment, Database};
|
||||||
|
|
@ -36,8 +36,11 @@ impl sea_orm_rocket::Pool for SeaOrmPool {
|
||||||
let mut options: ConnectOptions = database_url.into();
|
let mut options: ConnectOptions = database_url.into();
|
||||||
options
|
options
|
||||||
.max_connections(1024)
|
.max_connections(1024)
|
||||||
.min_connections(0)
|
.min_connections(5)
|
||||||
.connect_timeout(Duration::from_secs(3))
|
.connect_timeout(Duration::from_secs(15))
|
||||||
|
.acquire_timeout(Duration::from_secs(15))
|
||||||
|
.max_lifetime(Duration::from_secs(15))
|
||||||
|
.idle_timeout(Duration::from_secs(5))
|
||||||
.sqlx_logging(false);
|
.sqlx_logging(false);
|
||||||
|
|
||||||
/* options
|
/* options
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue