ferro_cli/commands/
schedule_work.rs1use console::style;
4use std::process::Command;
5
6pub fn run() {
7 println!("{} Starting scheduler daemon...", style("->").cyan());
8 println!("{}", style("Press Ctrl+C to stop").dim());
9 println!();
10
11 let status = Command::new("cargo")
13 .args(["run", "--quiet", "--", "schedule:work"])
14 .status()
15 .expect("Failed to execute cargo command");
16
17 if !status.success() {
18 if let Some(code) = status.code() {
21 if code != 130 {
22 eprintln!();
24 eprintln!(
25 "{} Scheduler daemon exited with error (code: {})",
26 style("Error:").red().bold(),
27 code
28 );
29 std::process::exit(1);
30 }
31 }
32 }
33
34 println!();
35 println!("{} Scheduler daemon stopped.", style("->").cyan());
36}