use std::env;
use std::path::PathBuf;
use std::thread;
use std::time::Duration;
use torrust_tracker_deployer_lib::infrastructure::persistence::filesystem::file_lock::FileLock;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let args: Vec<String> = env::args().collect();
if args.len() != 3 {
eprintln!("Usage: {} <file_path> <duration_seconds>", args[0]);
std::process::exit(1);
}
let file_path = PathBuf::from(&args[1]);
let duration_secs: u64 = args[2].parse().expect("Duration must be a positive number");
let _lock = FileLock::acquire(&file_path, Duration::from_secs(10))?;
thread::sleep(Duration::from_secs(duration_secs));
Ok(())
}