pub async fn prepare(
pool: &SqlitePool,
args: TuneArgs,
app_config: &BhtuneConfig,
) -> Result<PreparedTune>Expand description
The fast setup phase shared by [run_with_ctrl_c] (the CLI’s entry point) and drive
(the entry point for a caller – bhtune-server – that needs to start a run and return
control to its own caller before the run finishes). See PreparedTune’s doc comment
for why this split exists.
Identical in behavior to what run_with_ctrl_c did inline before this split: the
--write-pid-without---yes guard, bridge_host/server resolution, template lookup,
LoopConfig/LoopTags construction, driver connection, and the tune_runs insert all
run in exactly the same order against exactly the same inputs. Extracting this into its
own function changes nothing about what runs or when – only who else can call it.