This repository was archived by the owner on May 20, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,9 @@ password = "root"
10
10
# ## networks can run within the same MongoDB instance.
11
11
database_name = " chronicle"
12
12
13
+ # ## The minimum amount of connections in the pool.
14
+ min_pool_size = 2
15
+
13
16
[api ]
14
17
# ## Whether API requests will be served.
15
18
enabled = true
Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ impl MongoDb {
31
31
let mut client_options = ClientOptions :: parse ( & config. connect_url ) . await ?;
32
32
33
33
client_options. app_name = Some ( "Chronicle" . to_string ( ) ) ;
34
+ client_options. min_pool_size = config. min_pool_size ;
34
35
35
36
if let ( Some ( username) , Some ( password) ) = ( & config. username , & config. password ) {
36
37
let credential = Credential :: builder ( )
@@ -153,6 +154,8 @@ pub struct MongoDbConfig {
153
154
pub password : Option < String > ,
154
155
/// The name of the database to connect to.
155
156
pub database_name : String ,
157
+ /// The minimum amount of connections in the pool.
158
+ pub min_pool_size : Option < u32 > ,
156
159
}
157
160
158
161
impl Default for MongoDbConfig {
@@ -162,6 +165,7 @@ impl Default for MongoDbConfig {
162
165
username : None ,
163
166
password : None ,
164
167
database_name : MongoDb :: DEFAULT_NAME . to_string ( ) ,
168
+ min_pool_size : None ,
165
169
}
166
170
}
167
171
}
You can’t perform that action at this time.
0 commit comments