@@ -22,7 +22,7 @@ pub fn run_new_queue() -> bool {
2222/// Store the latest master commits or do nothing if all of them are
2323/// already in the database
2424async fn create_benchmark_request_master_commits (
25- ctxt : & Arc < SiteCtxt > ,
25+ ctxt : & SiteCtxt ,
2626 conn : & dyn database:: pool:: Connection ,
2727 index : & BenchmarkRequestIndex ,
2828) -> anyhow:: Result < ( ) > {
@@ -282,7 +282,7 @@ async fn process_benchmark_requests(
282282}
283283
284284/// For queueing jobs, add the jobs you want to queue to this function
285- async fn cron_enqueue_jobs ( site_ctxt : & Arc < SiteCtxt > ) -> anyhow:: Result < ( ) > {
285+ async fn cron_enqueue_jobs ( site_ctxt : & SiteCtxt ) -> anyhow:: Result < ( ) > {
286286 let mut conn = site_ctxt. conn ( ) . await ;
287287
288288 let index = conn. load_benchmark_request_index ( ) . await ?;
@@ -297,9 +297,9 @@ async fn cron_enqueue_jobs(site_ctxt: &Arc<SiteCtxt>) -> anyhow::Result<()> {
297297 Ok ( ( ) )
298298}
299299
300- /// Entry point for the cron
301- pub async fn cron_main ( site_ctxt : Arc < RwLock < Option < Arc < SiteCtxt > > > > , seconds : u64 ) {
302- let mut interval = time:: interval ( Duration :: from_secs ( seconds ) ) ;
300+ /// Entry point for the cron job that manages the benchmark request and job queue.
301+ pub async fn cron_main ( site_ctxt : Arc < RwLock < Option < Arc < SiteCtxt > > > > , run_interval : Duration ) {
302+ let mut interval = time:: interval ( run_interval ) ;
303303 let ctxt = site_ctxt. clone ( ) ;
304304
305305 loop {
@@ -484,7 +484,7 @@ mod tests {
484484 create_master( "mmm" , "aaa" , 18 ) ,
485485 ] ;
486486
487- db_insert_requests ( & * db, & requests) . await ;
487+ db_insert_requests ( db, & requests) . await ;
488488 db. attach_shas_to_try_benchmark_request ( 16 , "try1" , "rrr" , Utc :: now ( ) )
489489 . await
490490 . unwrap ( ) ;
@@ -496,15 +496,15 @@ mod tests {
496496 . unwrap ( ) ;
497497
498498 mark_as_completed (
499- & * db,
499+ db,
500500 & [ "bar" , "345" , "aaa" , "rrr" ] ,
501501 collector_name,
502502 benchmark_set,
503503 target,
504504 )
505505 . await ;
506506
507- let sorted: Vec < BenchmarkRequest > = build_queue ( & * db) . await . unwrap ( ) ;
507+ let sorted: Vec < BenchmarkRequest > = build_queue ( db) . await . unwrap ( ) ;
508508
509509 queue_order_matches ( & sorted, & [ "try1" , "v1.2.3" , "123" , "foo" , "mmm" , "baz" ] ) ;
510510 Ok ( ctx)
0 commit comments