File tree Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,13 @@ use parking_lot::RwLock;
1212use regex:: Regex ;
1313use tokio:: time:: { self , Duration } ;
1414
15+ pub fn run_new_queue ( ) -> bool {
16+ std:: env:: var ( "RUN_CRON" )
17+ . ok ( )
18+ . and_then ( |x| x. parse ( ) . ok ( ) )
19+ . unwrap_or ( false )
20+ }
21+
1522/// Store the latest master commits or do nothing if all of them are
1623/// already in the database
1724async fn create_benchmark_request_master_commits (
Original file line number Diff line number Diff line change 11use futures:: future:: FutureExt ;
22use parking_lot:: RwLock ;
3+ use site:: job_queue:: { cron_main, run_new_queue} ;
34use site:: load;
45use std:: env;
56use std:: sync:: Arc ;
@@ -33,10 +34,6 @@ async fn main() {
3334 . ok ( )
3435 . and_then ( |x| x. parse ( ) . ok ( ) )
3536 . unwrap_or ( 30 ) ;
36- let run_cron_job = env:: var ( "RUN_CRON" )
37- . ok ( )
38- . and_then ( |x| x. parse ( ) . ok ( ) )
39- . unwrap_or ( false ) ;
4037
4138 let fut = tokio:: task:: spawn_blocking ( move || {
4239 tokio:: task:: spawn ( async move {
@@ -62,9 +59,9 @@ async fn main() {
6259
6360 let server = site:: server:: start ( ctxt. clone ( ) , port) . fuse ( ) ;
6461
65- if run_cron_job {
62+ if run_new_queue ( ) {
6663 task:: spawn ( async move {
67- site :: job_queue :: cron_main ( ctxt. clone ( ) , queue_update_interval_seconds) . await ;
64+ cron_main ( ctxt. clone ( ) , queue_update_interval_seconds) . await ;
6865 } ) ;
6966 }
7067
You can’t perform that action at this time.
0 commit comments