@@ -19,8 +19,8 @@ use tracing::{debug, info};
1919/// NOTE: this should only be run once, otherwise crates would be added
2020/// to the queue multiple times.
2121pub async fn watch_registry (
22- build_queue : Arc < AsyncBuildQueue > ,
23- config : Arc < Config > ,
22+ build_queue : & AsyncBuildQueue ,
23+ config : & Config ,
2424 index : Arc < Index > ,
2525) -> Result < ( ) , Error > {
2626 let mut last_gc = Instant :: now ( ) ;
@@ -56,13 +56,12 @@ fn start_registry_watcher(context: &Context) -> Result<(), Error> {
5656 let build_queue = context. async_build_queue . clone ( ) ;
5757 let config = context. config . clone ( ) ;
5858 let index = context. index . clone ( ) ;
59- let runtime = context. runtime . clone ( ) ;
6059
61- runtime. spawn ( async {
60+ context . runtime . spawn ( async move {
6261 // space this out to prevent it from clashing against the queue-builder thread on launch
6362 tokio:: time:: sleep ( Duration :: from_secs ( 30 ) ) . await ;
6463
65- watch_registry ( build_queue, config, index) . await
64+ watch_registry ( & build_queue, & config, index) . await
6665 } ) ;
6766
6867 Ok ( ( ) )
@@ -195,14 +194,12 @@ pub fn start_daemon(context: Context, enable_registry_watcher: bool) -> Result<(
195194 }
196195
197196 // build new crates every minute
198- let build_queue = context. build_queue . clone ( ) ;
199- let config = context. config . clone ( ) ;
200197 let rustwide_builder = RustwideBuilder :: init ( & context) ?;
201198 thread:: Builder :: new ( )
202199 . name ( "build queue reader" . to_string ( ) )
203200 . spawn ( {
204201 let context = context. clone ( ) ;
205- move || queue_builder ( & context, rustwide_builder, build_queue , config ) . unwrap ( )
202+ move || queue_builder ( & context, rustwide_builder) . unwrap ( )
206203 } )
207204 . unwrap ( ) ;
208205
0 commit comments