@@ -19,8 +19,8 @@ use tracing::{debug, info};
19
19
/// NOTE: this should only be run once, otherwise crates would be added
20
20
/// to the queue multiple times.
21
21
pub async fn watch_registry (
22
- build_queue : Arc < AsyncBuildQueue > ,
23
- config : Arc < Config > ,
22
+ build_queue : & AsyncBuildQueue ,
23
+ config : & Config ,
24
24
index : Arc < Index > ,
25
25
) -> Result < ( ) , Error > {
26
26
let mut last_gc = Instant :: now ( ) ;
@@ -56,13 +56,12 @@ fn start_registry_watcher(context: &Context) -> Result<(), Error> {
56
56
let build_queue = context. async_build_queue . clone ( ) ;
57
57
let config = context. config . clone ( ) ;
58
58
let index = context. index . clone ( ) ;
59
- let runtime = context. runtime . clone ( ) ;
60
59
61
- runtime. spawn ( async {
60
+ context . runtime . spawn ( async move {
62
61
// space this out to prevent it from clashing against the queue-builder thread on launch
63
62
tokio:: time:: sleep ( Duration :: from_secs ( 30 ) ) . await ;
64
63
65
- watch_registry ( build_queue, config, index) . await
64
+ watch_registry ( & build_queue, & config, index) . await
66
65
} ) ;
67
66
68
67
Ok ( ( ) )
@@ -195,14 +194,12 @@ pub fn start_daemon(context: Context, enable_registry_watcher: bool) -> Result<(
195
194
}
196
195
197
196
// build new crates every minute
198
- let build_queue = context. build_queue . clone ( ) ;
199
- let config = context. config . clone ( ) ;
200
197
let rustwide_builder = RustwideBuilder :: init ( & context) ?;
201
198
thread:: Builder :: new ( )
202
199
. name ( "build queue reader" . to_string ( ) )
203
200
. spawn ( {
204
201
let context = context. clone ( ) ;
205
- move || queue_builder ( & context, rustwide_builder, build_queue , config ) . unwrap ( )
202
+ move || queue_builder ( & context, rustwide_builder) . unwrap ( )
206
203
} )
207
204
. unwrap ( ) ;
208
205
0 commit comments