Update 'mongodb' to '2' in 'db_pools'.

This commit is contained in:
Sergio Benitez 2022-02-16 11:01:35 -08:00
parent 543560a1f2
commit d25a8308e5
3 changed files with 3 additions and 3 deletions

View File

@ -52,7 +52,7 @@ features = ["rt_tokio_1"]
optional = true
[dependencies.mongodb]
version = "1"
version = "2"
default-features = false
features = ["tokio-runtime"]
optional = true

View File

@ -126,7 +126,7 @@
//! [`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
//!
//! ## `mongodb` (v1)
//! ## `mongodb` (v2)
//!
//! | Database | Feature | [`Pool`] Type and [`Connection`] Deref |
//! |----------|-----------|----------------------------------------|

View File

@ -256,8 +256,8 @@ mod mongodb {
opts.min_pool_size = config.min_connections;
opts.max_pool_size = Some(config.max_connections as u32);
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.server_selection_timeout = Some(Duration::from_secs(config.connect_timeout));
Client::with_options(opts).map_err(Error::Init)
}