[sqlite] launch daemon only if jobs > 1

Summary: As per title.

Reviewed By: jvillard

Differential Revision: D17181866

fbshipit-source-id: 26674d721
master
Nikos Gorogiannis 5 years ago committed by Facebook Github Bot
parent 8add080e4a
commit 01dc06b05f

@ -15,17 +15,12 @@ module L = Logging
let run driver_mode = let run driver_mode =
let open Driver in let open Driver in
if CLOpt.is_originator && Config.(sqlite_write_daemon && not (buck || genrule_mode)) then
DBWriter.start () ;
Utils.try_finally_swallow_timeout
~f:(fun () ->
run_prologue driver_mode ; run_prologue driver_mode ;
let changed_files = read_config_changed_files () in let changed_files = read_config_changed_files () in
InferAnalyze.invalidate_changed_procedures changed_files ; InferAnalyze.invalidate_changed_procedures changed_files ;
capture driver_mode ~changed_files ; capture driver_mode ~changed_files ;
analyze_and_report driver_mode ~changed_files ; analyze_and_report driver_mode ~changed_files ;
run_epilogue () ) run_epilogue ()
~finally:(fun () -> if CLOpt.is_originator && Config.sqlite_write_daemon then DBWriter.stop ())
let run driver_mode = ScubaLogging.execute_with_time_logging "run" (fun () -> run driver_mode) let run driver_mode = ScubaLogging.execute_with_time_logging "run" (fun () -> run driver_mode)
@ -62,7 +57,10 @@ let setup () =
if CLOpt.is_originator then ( if CLOpt.is_originator then (
RunState.add_run_to_sequence () ; RunState.add_run_to_sequence () ;
RunState.store () ; RunState.store () ;
if Config.memcached then Memcached.start () ) ; if Config.memcached then Memcached.start () ;
if Config.(sqlite_write_daemon && (not (buck || genrule_mode)) && jobs > 1) then (
DBWriter.start () ;
Epilogues.register ~f:DBWriter.stop ~description:"Stop Sqlite write daemon" ) ) ;
() ()

Loading…
Cancel
Save