| 571 | } |
| 572 | |
| 573 | fn print_lifecycle(lifecycle: &ManagedLifecycle, json: bool) -> CliResult<()> { |
| 574 | if json { |
| 575 | println!("{}", serde_json::to_string(lifecycle).unwrap()); |
| 576 | } else { |
| 577 | println!( |
| 578 | "Managed run {}: owner={} session={} view={} workdir={} expires_at={}", |
| 579 | lifecycle.run_id, |
| 580 | lifecycle.owner_agent, |
| 581 | lifecycle.owner_session_id, |
| 582 | lifecycle.view.as_deref().unwrap_or("-"), |
| 583 | lifecycle.workdir.display(), |
| 584 | lifecycle.expires_at, |
| 585 | ); |
| 586 | } |
| 587 | Ok(()) |
| 588 | } |
| 589 | |
| 590 | fn now_secs() -> i64 { |
| 591 | chrono::Utc::now().timestamp() |