File tree Expand file tree Collapse file tree 3 files changed +9
-4
lines changed
Expand file tree Collapse file tree 3 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -176,6 +176,7 @@ impl<DB: Database> PoolInner<DB> {
176176 . fuse ( ) ;
177177 }
178178
179+ // Try to acquire another connected connection.
179180 acquire_connected. set ( self . acquire_connected ( ) . fuse ( ) ) ;
180181 continue ;
181182 }
Original file line number Diff line number Diff line change @@ -632,7 +632,7 @@ fn default_shards() -> NonZero<usize> {
632632 #[ cfg( feature = "_rt-async-std" ) ]
633633 if let Some ( val) = std:: env:: var ( "ASYNC_STD_THREAD_COUNT" )
634634 . ok ( )
635- . and_then ( |s| s. parse ( ) )
635+ . and_then ( |s| s. parse ( ) . ok ( ) )
636636 {
637637 return val;
638638 }
Original file line number Diff line number Diff line change 1- use std:: { future:: Future , pin:: pin, time:: Duration } ;
1+ use std:: {
2+ future:: Future ,
3+ pin:: pin,
4+ time:: { Duration , Instant } ,
5+ } ;
26
37use futures_util:: future:: { select, Either } ;
48
59use crate :: rt:: TimeoutError ;
610
7- pub fn sleep ( duration : Duration ) {
11+ pub async fn sleep ( duration : Duration ) {
812 async_io:: Timer :: after ( duration) . await ;
913}
1014
@@ -13,7 +17,7 @@ pub async fn sleep_until(deadline: Instant) {
1317}
1418
1519pub async fn timeout < F : Future > ( duration : Duration , future : F ) -> Result < F :: Output , TimeoutError > {
16- match select ( pin ! ( future) , sleep ( duration) ) . await {
20+ match select ( pin ! ( future) , pin ! ( sleep( duration) ) ) . await {
1721 Either :: Left ( ( result, _) ) => Ok ( result) ,
1822 Either :: Right ( _) => Err ( TimeoutError ) ,
1923 }
You can’t perform that action at this time.
0 commit comments