File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -298,6 +298,9 @@ pub struct General {
298298 pub admin_username : String ,
299299 pub admin_password : String ,
300300
301+ #[ serde( default = "General::default_validate_config" ) ]
302+ pub validate_config : bool ,
303+
301304 // Support for auth query
302305 pub auth_query : Option < String > ,
303306 pub auth_query_user : Option < String > ,
@@ -367,6 +370,10 @@ impl General {
367370 pub fn default_idle_client_in_transaction_timeout ( ) -> u64 {
368371 0
369372 }
373+
374+ pub fn default_validate_config ( ) -> bool {
375+ true
376+ }
370377}
371378
372379impl Default for General {
@@ -402,6 +409,7 @@ impl Default for General {
402409 auth_query_user : None ,
403410 auth_query_password : None ,
404411 server_lifetime : 1000 * 3600 * 24 , // 24 hours,
412+ validate_config : true ,
405413 }
406414 }
407415}
Original file line number Diff line number Diff line change @@ -459,10 +459,12 @@ impl ConnectionPool {
459459 // Connect to the servers to make sure pool configuration is valid
460460 // before setting it globally.
461461 // Do this async and somewhere else, we don't have to wait here.
462- let mut validate_pool = pool. clone ( ) ;
463- tokio:: task:: spawn ( async move {
464- let _ = validate_pool. validate ( ) . await ;
465- } ) ;
462+ if config. general . validate_config {
463+ let mut validate_pool = pool. clone ( ) ;
464+ tokio:: task:: spawn ( async move {
465+ let _ = validate_pool. validate ( ) . await ;
466+ } ) ;
467+ }
466468
467469 // There is one pool per database/user pair.
468470 new_pools. insert ( PoolIdentifier :: new ( pool_name, & user. username ) , pool) ;
You can’t perform that action at this time.
0 commit comments