Skip to content

Commit 6fb7daf

Browse files
wip
1 parent 07f5939 commit 6fb7daf

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/modules/db/sqlx/mod.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -682,13 +682,12 @@ 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-
{
686-
let map = &mut *POOLS.lock().expect("could not lock mutex");
685+
686+
let map = &mut *POOLS.lock().expect("could not lock mutex");
687687

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-
}
688+
if let Some(con_ref) = map.get(&con_str) {
689+
if let Some(con_arc) = con_ref.upgrade() {
690+
return Ok(con_arc);
692691
}
693692
}
694693

@@ -743,7 +742,6 @@ impl SqlxConnection {
743742

744743
// register con in pools
745744
let arc = Arc::new(con);
746-
let map = &mut *POOLS.lock().expect("could not lock mutex");
747745
map.insert(con_str2, Arc::downgrade(&arc));
748746
// return arc
749747
Ok(arc)

0 commit comments

Comments
 (0)