File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ impl Runtime {
6767 {
6868 let mut background_tasks = self . background_tasks . lock ( ) . unwrap ( ) ;
6969 let runtime_handle = self . handle ( ) ;
70- background_tasks. spawn_on ( future, runtime_handle) ;
70+ background_tasks. spawn_on ( async { future. await } , runtime_handle) ;
7171 }
7272
7373 pub fn spawn_cancellable_background_task < F > ( & self , future : F )
@@ -76,7 +76,7 @@ impl Runtime {
7676 {
7777 let mut cancellable_background_tasks = self . cancellable_background_tasks . lock ( ) . unwrap ( ) ;
7878 let runtime_handle = self . handle ( ) ;
79- cancellable_background_tasks. spawn_on ( future, runtime_handle) ;
79+ cancellable_background_tasks. spawn_on ( async { future. await } , runtime_handle) ;
8080 }
8181
8282 pub fn spawn_background_processor_task < F > ( & self , future : F )
@@ -107,7 +107,7 @@ impl Runtime {
107107 // to detect the outer context here, and otherwise use whatever was set during
108108 // initialization.
109109 let handle = tokio:: runtime:: Handle :: try_current ( ) . unwrap_or ( self . handle ( ) . clone ( ) ) ;
110- tokio:: task:: block_in_place ( move || handle. block_on ( future) )
110+ tokio:: task:: block_in_place ( move || handle. block_on ( async { future. await } ) )
111111 }
112112
113113 pub fn abort_cancellable_background_tasks ( & self ) {
You can’t perform that action at this time.
0 commit comments