From 30ea384573d6bf354811837423b47347dadd279a Mon Sep 17 00:00:00 2001 From: Accusys Date: Sun, 4 Oct 2026 16:32:30 +0800 Subject: [PATCH] fix: complete processing.rs path cleanup (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 throughout Verification: cargo check --lib passes, 0 hardcoded paths Progress: admin_config.rs ✅, files.rs ✅, watcher.rs ✅, processing.rs ✅ --- src/api/processing.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/api/processing.rs b/src/api/processing.rs index 0e0cce7e..2d8ddc2a 100644 --- a/src/api/processing.rs +++ b/src/api/processing.rs @@ -467,8 +467,7 @@ async fn download_json( State(state): State, Path((file_uuid, processor)): Path<(String, String)>, ) -> Result, StatusCode> { - 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 path = std::path::Path::new(&output_dir).join(format!("{}.{}.json", file_uuid, processor)); let content = tokio::fs::read_to_string(&path) .await @@ -815,8 +814,7 @@ async fn get_processor_counts( }); let file_uuid = full_uuid.ok_or(StatusCode::NOT_FOUND)?; - 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 processors = crate::core::db::ProcessorType::all(); let mut results = Vec::new();