diff --git a/src/api/files.rs b/src/api/files.rs index be7901ca..950b4741 100644 --- a/src/api/files.rs +++ b/src/api/files.rs @@ -1166,6 +1166,8 @@ struct ReScanRequest { #[serde(default)] face_settings: Option, #[serde(default)] + auto_pipeline: Option, + #[serde(default)] trigger_source: Option, #[serde(default)] reason: Option, @@ -1400,11 +1402,13 @@ async fn re_scan( } }; - // Step 2: Create register command with force=true +// Step 2: Create register command with force=true // Note: force=true will automatically unregister existing file if needed + let auto_pipeline = req.auto_pipeline.unwrap_or(false); + let register_payload = serde_json::json!({ "force": true, - "auto_pipeline": true, // Flag to force auto-pipeline + "auto_pipeline": auto_pipeline, "content_hash": null, "face_settings": req.face_settings.as_ref().map(|fs| { serde_json::json!({ @@ -1436,7 +1440,14 @@ async fn re_scan( // Note: Register command with force=true will: // 1. Unregister existing file if needed // 2. Register the file - // 3. Trigger auto-pipeline if auto_pipeline flag is set + // 3. Trigger auto-pipeline only if auto_pipeline=true (default: false) + + let mode = if auto_pipeline { "auto" } else { "manual" }; + tracing::info!( + "[RE-SCAN] Mode: {} (auto_pipeline={})", + mode, + auto_pipeline + ); Ok(Json(ReScanResponse { success: true, diff --git a/src/core/processor/executor.rs b/src/core/processor/executor.rs index 94101d31..24206fc3 100644 --- a/src/core/processor/executor.rs +++ b/src/core/processor/executor.rs @@ -174,7 +174,7 @@ impl PythonExecutor { if !scripts_path.exists() { anyhow::bail!( - "Scripts directory not found at {} (set MOMENTRY_SCRIPTS_DIR env var)", + "Scripts directory not found at {:?} (set MOMENTRY_SCRIPTS_DIR env var)", scripts_dir ); } @@ -1422,7 +1422,7 @@ impl CliExecutor { if !cli_path.exists() { anyhow::bail!( - "CLI directory not found at {} (set MOMENTRY_CLI_DIR env var)", + "CLI directory not found at {:?} (set MOMENTRY_CLI_DIR env var)", cli_dir ); }