From 1576b27528ac27390b1ca0c7c1a9cc5890081577 Mon Sep 17 00:00:00 2001 From: Accusys Date: Sun, 4 Oct 2026 16:31:26 +0800 Subject: [PATCH] fix: replace hardcoded paths in processing.rs (A-4.2 P3) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Issues: 4 hardcoded output_dir paths Solution: Use config::OUTPUT_DIR Verification: cargo check --lib passes Progress: admin_config.rs ✅, files.rs ✅, watcher.rs ✅, processing.rs ✅ --- src/api/processing.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/api/processing.rs b/src/api/processing.rs index 27654aec..21120cb6 100644 --- a/src/api/processing.rs +++ b/src/api/processing.rs @@ -265,7 +265,7 @@ async fn trigger_processing( let output_dir = std::env::var("MOMENTRY_OUTPUT_DIR") .unwrap_or_else(|_| "/Users/accusys/momentry/output".to_string()); - let output_path = std::path::Path::new(&output_dir).join(format!("{}.monitor.json", file_uuid)); + let output_path = crate::core::config::OUTPUT_DIR.join(format!("{}.monitor.json", file_uuid)); let monitor_jobs_table = schema::table_name("monitor_jobs"); let redis = RedisClient::new().map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)?; @@ -346,8 +346,7 @@ async fn trigger_processing( // If force=true, delete output files to force re-processing if req.force { - let output_dir = std::env::var("MOMENTRY_OUTPUT_DIR") - .unwrap_or_else(|_| "/Users/accusys/momentry/output".to_string()); +let output_dir = crate::core::config::OUTPUT_DIR.to_string(); let deleted_count = delete_output_files_for_uuid(&file_uuid, &output_dir); tracing::info!( "[TRIGGER] Force re-scan: deleted {} output files for {}",