@@ -4,11 +4,11 @@ use anyhow::Result;
44use clap:: { Parser , Subcommand } ;
55use figment:: Figment ;
66use mimalloc:: MiMalloc ;
7+ use modkit:: LocalProcessBackend ;
78use modkit:: bootstrap:: config:: {
8- get_module_runtime_config , render_module_config_for_oop , AppConfig , RuntimeKind ,
9+ AppConfig , RuntimeKind , get_module_runtime_config , render_module_config_for_oop ,
910} ;
1011use modkit:: bootstrap:: host:: { init_logging_unified, normalize_executable_path} ;
11- use modkit:: LocalProcessBackend ;
1212use tokio_util:: sync:: CancellationToken ;
1313
1414use std:: path:: { Path , PathBuf } ;
@@ -23,7 +23,7 @@ static GLOBAL: MiMalloc = MiMalloc;
2323
2424// Bring runner types & our per-module DB factory
2525use modkit:: runtime:: {
26- run , shutdown , DbOptions , OopModuleSpawnConfig , OopSpawnOptions , RunOptions , ShutdownOptions ,
26+ DbOptions , OopModuleSpawnConfig , OopSpawnOptions , RunOptions , ShutdownOptions , run , shutdown ,
2727} ;
2828
2929fn ensure_drivers_linked ( ) {
@@ -115,10 +115,10 @@ async fn main() -> Result<()> {
115115
116116 // One-time connectivity probe
117117 #[ cfg( feature = "otel" ) ]
118- if let Some ( tc) = modkit_tracing_config. as_ref ( ) {
119- if let Err ( e) = modkit:: telemetry:: init:: otel_connectivity_probe ( tc) {
120- tracing :: error! ( error = %e , "OTLP connectivity probe failed" ) ;
121- }
118+ if let Some ( tc) = modkit_tracing_config. as_ref ( )
119+ && let Err ( e) = modkit:: telemetry:: init:: otel_connectivity_probe ( tc)
120+ {
121+ tracing :: error! ( error = %e , "OTLP connectivity probe failed" ) ;
122122 }
123123
124124 // Smoke test span to confirm traces flow to Jaeger
@@ -285,41 +285,41 @@ fn build_oop_spawn_options(
285285 let mut modules = Vec :: new ( ) ;
286286
287287 for module_name in config. modules . keys ( ) {
288- if let Some ( runtime_cfg) = get_module_runtime_config ( config, module_name) ? {
289- if runtime_cfg. mod_type == RuntimeKind :: Oop {
290- let exec_cfg = runtime_cfg. execution . as_ref ( ) . ok_or_else ( || {
291- anyhow:: anyhow!(
292- "module '{module_name}' is type=oop but execution config is missing"
293- )
294- } ) ?;
295-
296- let binary = normalize_executable_path ( & exec_cfg. executable_path ) ?;
297-
298- // Copy args from execution config as-is
299- // User controls --config via execution.args in master config
300- let spawn_args = exec_cfg. args . clone ( ) ;
301-
302- // Copy environment from execution config
303- let env = exec_cfg. environment . clone ( ) ;
304-
305- // Render the complete module config (with resolved DB)
306- let rendered_config = render_module_config_for_oop ( config, module_name, & home_dir) ?;
307- let rendered_json = rendered_config. to_json ( ) ?;
308- tracing:: debug!(
309- module = %module_name,
310- "Prepared OoP module config: db={}" ,
311- rendered_config. database. is_some( )
312- ) ;
288+ if let Some ( runtime_cfg) = get_module_runtime_config ( config, module_name) ?
289+ && runtime_cfg. mod_type == RuntimeKind :: Oop
290+ {
291+ let exec_cfg = runtime_cfg. execution . as_ref ( ) . ok_or_else ( || {
292+ anyhow:: anyhow!(
293+ "module '{module_name}' is type=oop but execution config is missing"
294+ )
295+ } ) ?;
296+
297+ let binary = normalize_executable_path ( & exec_cfg. executable_path ) ?;
298+
299+ // Copy args from execution config as-is
300+ // User controls --config via execution.args in master config
301+ let spawn_args = exec_cfg. args . clone ( ) ;
302+
303+ // Copy environment from execution config
304+ let env = exec_cfg. environment . clone ( ) ;
305+
306+ // Render the complete module config (with resolved DB)
307+ let rendered_config = render_module_config_for_oop ( config, module_name, & home_dir) ?;
308+ let rendered_json = rendered_config. to_json ( ) ?;
309+ tracing:: debug!(
310+ module = %module_name,
311+ "Prepared OoP module config: db={}" ,
312+ rendered_config. database. is_some( )
313+ ) ;
313314
314- modules. push ( OopModuleSpawnConfig {
315- module_name : module_name. clone ( ) ,
316- binary,
317- args : spawn_args,
318- env,
319- working_directory : exec_cfg. working_directory . clone ( ) ,
320- rendered_config_json : rendered_json,
321- } ) ;
322- }
315+ modules. push ( OopModuleSpawnConfig {
316+ module_name : module_name. clone ( ) ,
317+ binary,
318+ args : spawn_args,
319+ env,
320+ working_directory : exec_cfg. working_directory . clone ( ) ,
321+ rendered_config_json : rendered_json,
322+ } ) ;
323323 }
324324 }
325325
0 commit comments