File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -682,11 +682,13 @@ impl SqlxConnection {
682682 let con_str = format ! ( "{protocol_type}://{user}:{pass}@{host}:{port}{db}" ) ;
683683
684684 // see if we have a wrapper with the correct con_str
685- let map = & mut * POOLS . lock ( ) . expect ( "could not lock mutex" ) ;
685+ {
686+ let map = & mut * POOLS . lock ( ) . expect ( "could not lock mutex" ) ;
686687
687- if let Some ( con_ref) = map. get ( & con_str) {
688- if let Some ( con_arc) = con_ref. upgrade ( ) {
689- return Ok ( con_arc) ;
688+ if let Some ( con_ref) = map. get ( & con_str) {
689+ if let Some ( con_arc) = con_ref. upgrade ( ) {
690+ return Ok ( con_arc) ;
691+ }
690692 }
691693 }
692694
@@ -741,6 +743,7 @@ impl SqlxConnection {
741743
742744 // register con in pools
743745 let arc = Arc :: new ( con) ;
746+ let map = & mut * POOLS . lock ( ) . expect ( "could not lock mutex" ) ;
744747 map. insert ( con_str2, Arc :: downgrade ( & arc) ) ;
745748 // return arc
746749 Ok ( arc)
You can’t perform that action at this time.
0 commit comments