fix: save probe.json to OUTPUT_DIR instead of current directory
- Changed FileManager base directory from '.' to OUTPUT_DIR - Fixed both register and probe endpoints - probe.json is now saved to /Users/accusys/momentry/output/
This commit is contained in:
@@ -516,7 +516,9 @@ async fn register(
|
||||
}
|
||||
}
|
||||
|
||||
let file_manager = FileManager::new(std::path::PathBuf::from("."));
|
||||
let file_manager = FileManager::new(std::path::PathBuf::from(
|
||||
crate::core::config::OUTPUT_DIR.as_str(),
|
||||
));
|
||||
let json_str =
|
||||
serde_json::to_string(&probe_result).map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)?;
|
||||
let _json_path = file_manager
|
||||
@@ -643,8 +645,10 @@ async fn probe(
|
||||
StatusCode::INTERNAL_SERVER_ERROR
|
||||
})?;
|
||||
|
||||
// Save probe.json
|
||||
let file_manager = FileManager::new(std::path::PathBuf::from("."));
|
||||
// Save probe.json to OUTPUT_DIR
|
||||
let file_manager = FileManager::new(std::path::PathBuf::from(
|
||||
crate::core::config::OUTPUT_DIR.as_str(),
|
||||
));
|
||||
let json_str = serde_json::to_string(&result).map_err(|e| {
|
||||
tracing::error!("Failed to serialize probe result: {}", e);
|
||||
StatusCode::INTERNAL_SERVER_ERROR
|
||||
|
||||
Reference in New Issue
Block a user