From bbf6c14a867a7502023d461d3d90715d2e48a7bc Mon Sep 17 00:00:00 2001 From: Antonio Nuno Monteiro Date: Tue, 18 Aug 2026 23:30:57 -0700 Subject: [PATCH] refactor(cli): share scheduler configuration setup Signed-off-by: Antonio Nuno Monteiro --- bin/scheduler_setup.ml | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/bin/scheduler_setup.ml b/bin/scheduler_setup.ml index 516aaf3e446..b0467b7cfd7 100644 --- a/bin/scheduler_setup.ml +++ b/bin/scheduler_setup.ml @@ -1,20 +1,22 @@ open Import open Scheduler -let no_build_no_rpc ~config:dune_config f = +let scheduler_config dune_config ~watch_exclusions = let config = - Dune_config.for_scheduler dune_config ~print_ctrl_c_warning:true ~watch_exclusions:[] + Dune_config.for_scheduler dune_config ~print_ctrl_c_warning:true ~watch_exclusions in Clflags.concurrency := config.concurrency; + config +;; + +let no_build_no_rpc ~config:dune_config f = + let config = scheduler_config dune_config ~watch_exclusions:[] in Run.go config f ;; let go_without_rpc_server ~(common : Common.t) ~config:dune_config f = - let config = - let watch_exclusions = Common.watch_exclusions common in - Dune_config.for_scheduler dune_config ~print_ctrl_c_warning:true ~watch_exclusions - in - Clflags.concurrency := config.concurrency; + let watch_exclusions = Common.watch_exclusions common in + let config = scheduler_config dune_config ~watch_exclusions in Run.go config f ;; @@ -45,11 +47,8 @@ let go_with_rpc_server ~common ~config f = ;; let go_with_rpc_server_and_file_watcher ~(common : Common.t) ~config:dune_config run = - let config = - let watch_exclusions = Common.watch_exclusions common in - Dune_config.for_scheduler dune_config ~print_ctrl_c_warning:true ~watch_exclusions - in - Clflags.concurrency := config.concurrency; + let watch_exclusions = Common.watch_exclusions common in + let config = scheduler_config dune_config ~watch_exclusions in let file_watcher = Common.file_watcher common in let run () = match Common.rpc common with