Ver código fonte

Apply suggestion from @crodas

Co-authored-by: C <cesar@rodas.me>
tsk 1 mês atrás
pai
commit
18e40d7912
1 arquivos alterados com 1 adições e 1 exclusões
  1. 1 1
      crates/cdk-sql-common/src/pool.rs

+ 1 - 1
crates/cdk-sql-common/src/pool.rs

@@ -192,7 +192,7 @@ where
         let time = Instant::now();
 
         loop {
-            if let Some((stale, resource)) = resources.pop() {
+            while let Some((stale, resource)) = resources.pop() {
                 if !stale.load(Ordering::SeqCst) {
                     // Increment counter BEFORE releasing the mutex to prevent race condition
                     // where another thread sees in_use < max_size and creates a duplicate connection.