| 10 | pub mod handler; |
| 11 | |
| 12 | fn cleanup_processes() { |
| 13 | if let Ok(output) = Command::new("ps").args(["-ef"]).output() { |
| 14 | println!("--- Process list before cleanup ---"); |
| 15 | if let Ok(process_list) = String::from_utf8(output.stdout) { |
| 16 | println!("{}", process_list); |
| 17 | } |
| 18 | } |
| 19 | |
| 20 | // Kill any orphaned Z3 processes |
| 21 | let _ = Command::new("pkill").args(["-9", "z3"]).output(); |
| 22 | |
| 23 | // Kill any orphaned dotnet processes |
| 24 | let _ = Command::new("pkill").args(["-9", "dotnet"]).output(); |
| 25 | |
| 26 | // Clean temp files |
| 27 | remove_dir_all("/tmp").ok(); |
| 28 | create_dir_all("/tmp/lambda").ok(); |
| 29 | } |
| 30 | |
| 31 | fn make_error_response(status_code: u16, error: &str) -> Value { |
| 32 | json!({ |