mirror of https://github.com/rwf2/Rocket.git
Update 'mongodb' to '2' in 'db_pools'.
This commit is contained in:
parent
543560a1f2
commit
d25a8308e5
|
@ -52,7 +52,7 @@ features = ["rt_tokio_1"]
|
||||||
optional = true
|
optional = true
|
||||||
|
|
||||||
[dependencies.mongodb]
|
[dependencies.mongodb]
|
||||||
version = "1"
|
version = "2"
|
||||||
default-features = false
|
default-features = false
|
||||||
features = ["tokio-runtime"]
|
features = ["tokio-runtime"]
|
||||||
optional = true
|
optional = true
|
||||||
|
|
|
@ -126,7 +126,7 @@
|
||||||
//! [`sqlx::PoolConnection<Sqlite>`]: https://docs.rs/sqlx/0.5/sqlx/pool/struct.PoolConnection.html
|
//! [`sqlx::PoolConnection<Sqlite>`]: https://docs.rs/sqlx/0.5/sqlx/pool/struct.PoolConnection.html
|
||||||
//! [`sqlx::PoolConnection<Mssql>`]: https://docs.rs/sqlx/0.5/sqlx/pool/struct.PoolConnection.html
|
//! [`sqlx::PoolConnection<Mssql>`]: https://docs.rs/sqlx/0.5/sqlx/pool/struct.PoolConnection.html
|
||||||
//!
|
//!
|
||||||
//! ## `mongodb` (v1)
|
//! ## `mongodb` (v2)
|
||||||
//!
|
//!
|
||||||
//! | Database | Feature | [`Pool`] Type and [`Connection`] Deref |
|
//! | Database | Feature | [`Pool`] Type and [`Connection`] Deref |
|
||||||
//! |----------|-----------|----------------------------------------|
|
//! |----------|-----------|----------------------------------------|
|
||||||
|
|
|
@ -256,8 +256,8 @@ mod mongodb {
|
||||||
opts.min_pool_size = config.min_connections;
|
opts.min_pool_size = config.min_connections;
|
||||||
opts.max_pool_size = Some(config.max_connections as u32);
|
opts.max_pool_size = Some(config.max_connections as u32);
|
||||||
opts.max_idle_time = config.idle_timeout.map(Duration::from_secs);
|
opts.max_idle_time = config.idle_timeout.map(Duration::from_secs);
|
||||||
opts.wait_queue_timeout = Some(Duration::from_secs(config.connect_timeout));
|
|
||||||
opts.connect_timeout = Some(Duration::from_secs(config.connect_timeout));
|
opts.connect_timeout = Some(Duration::from_secs(config.connect_timeout));
|
||||||
|
opts.server_selection_timeout = Some(Duration::from_secs(config.connect_timeout));
|
||||||
Client::with_options(opts).map_err(Error::Init)
|
Client::with_options(opts).map_err(Error::Init)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue